[prometheus] Fix OpenMetrics format suffixes#5646
Merged
CodeBlanch merged 11 commits intoopen-telemetry:mainfrom May 28, 2024
robertcoltheart:bug/fix-openmetrics-suffixes
Merged
[prometheus] Fix OpenMetrics format suffixes#5646CodeBlanch merged 11 commits intoopen-telemetry:mainfrom robertcoltheart:bug/fix-openmetrics-suffixes
CodeBlanch merged 11 commits intoopen-telemetry:mainfrom
robertcoltheart:bug/fix-openmetrics-suffixes
Conversation
robertcoltheart
commented
May 22, 2024
src/OpenTelemetry.Exporter.Prometheus.HttpListener/Internal/PrometheusMetric.cs
Show resolved
Hide resolved
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5646 +/- ##
===========================================
- Coverage 83.38% 20.12% -63.27%
===========================================
Files 297 185 -112
Lines 12531 7917 -4614
===========================================
- Hits 10449 1593 -8856
- Misses 2082 6324 +4242
Flags with carried forward coverage won't be shown. Click here to find out more.
|
reyang
approved these changes
May 22, 2024
cijothomas
approved these changes
May 23, 2024
Member
|
@robertcoltheart Thanks a lot for taking good care of Prometheus exporters! |
Thibautbrac
approved these changes
May 23, 2024
dashpole
reviewed
May 23, 2024
src/OpenTelemetry.Exporter.Prometheus.HttpListener/Internal/PrometheusMetric.cs
Outdated
Show resolved
Hide resolved
dashpole
reviewed
May 23, 2024
src/OpenTelemetry.Exporter.Prometheus.HttpListener/Internal/PrometheusMetric.cs
Outdated
Show resolved
Hide resolved
Member
|
@robertcoltheart I'm happy to merge this because there are approvals but there is also some open feedback from @dashpole. Are you going to respond or make more changes or should I merge? |
Contributor
Author
|
Let me make the suggested changes, and then we can review again |
dashpole
approved these changes
May 24, 2024
vishweshbankwar
approved these changes
May 28, 2024
This was referenced Sep 8, 2025
This was referenced Oct 11, 2025
Closed
This was referenced Oct 29, 2025
This was referenced Nov 19, 2025
Closed
Closed
This was referenced Jan 16, 2026
Closed
This was referenced Jan 24, 2026
Open
Closed
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5502
Changes
According to the OpenMetrics specs,
unitmust be a suffix of the metric name, and not just infix in the name. This PR also complies with the requirement that counters MUST end with_total, although this clashes with the OTEL spec that says it should be optional. Additionally, UNIT, HELP and TYPE metadata should not include the_totalsuffix, as seen in examples in the OpenMetrics specs.Tested with the latest version of Prometheus.
See:
Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial changes