Stop converting unit "1" to "ratio" in Prometheus exporter#8252
Open
anuq wants to merge 1 commit intoopen-telemetry:mainfrom
Open
Stop converting unit "1" to "ratio" in Prometheus exporter#8252anuq wants to merge 1 commit intoopen-telemetry:mainfrom
anuq wants to merge 1 commit intoopen-telemetry:mainfrom
Conversation
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
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Alternatively, if the co-author should not be included, remove the Please update your commit message(s) by doing |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8252 +/- ##
============================================
- Coverage 90.32% 90.32% -0.01%
- Complexity 7651 7653 +2
============================================
Files 842 842
Lines 23075 23074 -1
Branches 2312 2312
============================================
- Hits 20842 20841 -1
Misses 1514 1514
Partials 719 719 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Member
|
Please sign the CLA - thanks! |
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