Stop converting unit "1" to "ratio" in Prometheus exporter by anuq · Pull Request #8252 · open-telemetry/opentelemetry-java

@anuq

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

@linux-foundation-easycla

CLA Signed

The committers listed above are authorized under a signed CLA.

@codecov

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

Please sign the CLA - thanks!

breedx-splk

Choose a reason for hiding this comment

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

LGTM thanks!

@anuq

Please sign the CLA - thanks!

signed the CLA, thanks.

@anuq

@anuq