Skip to content

Stop converting unit "1" to "ratio" in Prometheus exporter#8252

Open
anuq wants to merge 2 commits intoopen-telemetry:mainfrom
anuq:fix/prometheus-stop-converting-1-to-ratio
Open

Stop converting unit "1" to "ratio" in Prometheus exporter#8252
anuq wants to merge 2 commits intoopen-telemetry:mainfrom
anuq:fix/prometheus-stop-converting-1-to-ratio

Conversation

@anuq
Copy link
Copy Markdown

@anuq anuq commented Apr 5, 2026

Summary

  • Remove initUnit("1", "ratio") mapping from PrometheusUnitsHelper
  • Treat unit "1" as unitless (return null from convertUnit), including after curly-brace annotation stripping (e.g. "1{dropped}")
  • Update tests to reflect the new behavior

Aligns with spec change in open-telemetry/opentelemetry-specification#4966.

Fixes #8237

@anuq anuq requested a review from a team as a code owner April 5, 2026 15:04
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla bot commented Apr 5, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.27%. Comparing base (7fcacb0) to head (4154425).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8252      +/-   ##
============================================
- Coverage     90.27%   90.27%   -0.01%     
- Complexity     7684     7686       +2     
============================================
  Files           850      850              
  Lines         23186    23185       -1     
  Branches       2352     2352              
============================================
- Hits          20931    20930       -1     
  Misses         1530     1530              
  Partials        725      725              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jack-berg
Copy link
Copy Markdown
Member

Please sign the CLA - thanks!

Copy link
Copy Markdown
Contributor

@breedx-splk breedx-splk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks!

@anuq
Copy link
Copy Markdown
Author

anuq commented Apr 10, 2026

Please sign the CLA - thanks!

signed the CLA, thanks.

@anuq anuq force-pushed the fix/prometheus-stop-converting-1-to-ratio branch from 05d640a to 53480a8 Compare April 11, 2026 00:43
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
@anuq anuq force-pushed the fix/prometheus-stop-converting-1-to-ratio branch from 62bf439 to fa4e8c0 Compare April 11, 2026 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prometheus exporter: stop converting 1 to ratio

3 participants