-
Notifications
You must be signed in to change notification settings - Fork 849
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prometheus exporter add duplicated suffix for counter metrics #5304
Comments
@dashpole this seems reasonable but I don't see any mention of this scenario in the prometheus openmetrics compatibility document. What do you think? Should the compatibility doc be updated to say that "_total" should be appended if not already present? |
Hi, @jack-berg. I notice that there is such a requirement in the specification:
|
Sorry @ShadowySpirits for the delayed reply. I see that the spec says "Monotonic Sum metric points MUST have _total added as a suffix to the metric name". I think for the behavior to be what you suggest the text would need to read something like: "Monotonic Sum metric points MUST have _total suffix. If the metric name does not end with _total, it MUST be added." |
Your explanation makes sense, but repeating |
💯 @dashpole can you offer some insight here? |
@jack-berg @dashpole Have there been any updates? I noticed that my pull request was closed due to being stale. |
Sorry about that - I thought we might get some feedback from the spec. Even though the spec doesn't explicitly describe the behavior of only adding "_total" if the name doesn't already end with it, I think its reasonable. I also think this is the behavior of the prometheus java http client. I believe this code strips the I re-opened and approved your PR. Thanks for you patience. |
@jack-berg Thanks a lot! |
Sorry, I was out on leave. Yes, please do not add a second _total if it is already the suffix of the metric. I can clarify that in the spec if you haven't already. |
Thanks @dashpole. I did not update the spec. |
Clarifies that _total does not need to be added as a suffix to counters if it already exists. There was confusion in open-telemetry/opentelemetry-java#5304 (comment) if that was correct or not.
…elemetry#3581) Clarifies that _total does not need to be added as a suffix to counters if it already exists. There was confusion in open-telemetry/opentelemetry-java#5304 (comment) if that was correct or not.
Describe the bug
Prometheus exporter will add duplicated suffix
_total
.Additional context
Prometheus exporter will add a
_total
suffix for all counter metrics. I think it should have a check that the metrics name already ends at_total
.opentelemetry-java/exporters/prometheus/src/main/java/io/opentelemetry/exporter/prometheus/Serializer.java
Lines 515 to 520 in 3d5424a
If the community agrees that this is a bug, I'm willing to submit a patch to fix it.
The text was updated successfully, but these errors were encountered: