Stop converting unit "1" to "ratio" in Prometheus exporter#8252
Merged
jack-berg merged 3 commits intoopen-telemetry:mainfrom Apr 17, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8252 +/- ##
============================================
- Coverage 90.25% 90.25% -0.01%
- Complexity 7684 7686 +2
============================================
Files 850 850
Lines 23195 23194 -1
Branches 2354 2354
============================================
- Hits 20935 20934 -1
Misses 1533 1533
Partials 727 727 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Member
|
Please sign the CLA - thanks! |
Contributor
Author
signed the CLA, thanks. |
05d640a to
53480a8
Compare
Remove the `initUnit("1", "ratio")` mapping and treat unit "1" as
unitless (returning null from convertUnit), aligning with the spec
change in open-telemetry/opentelemetry-specification#4966.
This also handles the edge case where "1" remains after stripping
curly-brace annotations (e.g. "1{dropped}").
Fixes open-telemetry#8237
62bf439 to
fa4e8c0
Compare
…y-java into fix/prometheus-stop-converting-1-to-ratio
jack-berg
approved these changes
Apr 16, 2026
Contributor
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.
Summary
initUnit("1", "ratio")mapping fromPrometheusUnitsHelper"1"as unitless (returnnullfromconvertUnit), including after curly-brace annotation stripping (e.g."1{dropped}")Aligns with spec change in open-telemetry/opentelemetry-specification#4966.
Fixes #8237