Skip to content

Align UCUM byte unit conversions with the specification table - #8752

Open
thswlsqls wants to merge 1 commit into
open-telemetry:mainfrom
thswlsqls:fix/prometheus-unit-tebibytes-and-lowercase-kilo
Open

Align UCUM byte unit conversions with the specification table#8752
thswlsqls wants to merge 1 commit into
open-telemetry:mainfrom
thswlsqls:fix/prometheus-unit-tebibytes-and-lowercase-kilo

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Fixes #8751

Description

  • Spec unit table: TiBy -> tebibytes, kBy -> kilobytes. The referencing section is Status: Stable; the conversion is a MUST.
  • We had TiBy -> tibibytes, and only upper case KBy, so kBy went out unconverted.
  • KBy is not in the table (K is kelvin in UCUM) but stays as an alias, so existing users keep kilobytes.
  • Metric names change: ..._tibibytes becomes ..._tebibytes. The existing test asserted tibibytes, so it is corrected too.
  • No compatibility switch: Stop converting unit "1" to "ratio" in Prometheus exporter #8252 changed this table for the far more common unit 1 with no switch or deprecation, and this artifact is alpha.
  • Upstream prometheus/otlptranslator fixed both entries but kept the old spellings in an opt-out legacyUnitMap; happy to do the same here.

Testing done

  • PrometheusUnitsHelperTest: the TiBy case now expects tebibytes, plus a new kBy -> kilobytes case. Both fail before the fix (tibibytes, kBy) and pass after.
  • ./gradlew :exporters:prometheus:check — 203 tests plus testJpms pass.
  • No apidiff change: alpha artifact, package-private class.

@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.29%. Comparing base (e2efec5) to head (d6996ab).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #8752   +/-   ##
=========================================
  Coverage     91.29%   91.29%           
  Complexity    10498    10498           
=========================================
  Files          1006     1006           
  Lines         28338    28339    +1     
  Branches       3581     3581           
=========================================
+ Hits          25870    25872    +2     
  Misses         1675     1675           
+ Partials        793      792    -1     

☔ View full report in Codecov by Harness.
📢 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.

@thswlsqls
thswlsqls marked this pull request as ready for review September 2, 2026 04:04
@thswlsqls
thswlsqls requested a review from a team as a code owner September 2, 2026 04:04
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Sep 2, 2026

Copy link
Copy Markdown

Pull request dashboard status

Waiting on maintainers · refreshed 2026-09-03 17:27 UTC

Merge when ready.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

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 converts TiBy to tibibytes and does not map kBy

2 participants