Describe the bug
PrometheusUnitsHelper disagrees with the specification's UCUM unit table on two byte units: TiBy is converted to tibibytes, and only upper case KBy is mapped while the table lists lower case kBy.
Steps to reproduce
Record a metric whose unit is TiBy or kBy and export it through the Prometheus exporter, or call PrometheusUnitsHelper.convertUnit with those units.
What did you expect to see?
tebibytes and kilobytes. The unit table lists TiBy -> tebibytes and kBy -> kilobytes. The "OTLP Metric points to Prometheus / Metric Metadata" section that references it is marked Status: Stable and says the unit MUST be converted using that table.
What did you see instead?
tibibytes, and kBy left unconverted as kBy. Both come from the static initializer of PrometheusUnitsHelper (exporters/prometheus/src/main/java/io/opentelemetry/exporter/prometheus/PrometheusUnitsHelper.java, lines 41-42).
What version and what artifacts are you using?
Artifacts: opentelemetry-exporter-prometheus (alpha)
Version: main @ 3a9fdc6
How did you reference these artifacts? N/A
Environment
Compiler: Temurin 21
OS: N/A
Additional context
This changes exposed metric names (..._tibibytes -> ..._tebibytes). The existing test asserting tibibytes encodes the same mistake, so it has to be corrected too. Upstream prometheus/otlptranslator already fixed both entries, keeping the old spellings in an opt-out legacyUnitMap.
Describe the bug
PrometheusUnitsHelperdisagrees with the specification's UCUM unit table on two byte units:TiByis converted totibibytes, and only upper caseKByis mapped while the table lists lower casekBy.Steps to reproduce
Record a metric whose unit is
TiByorkByand export it through the Prometheus exporter, or callPrometheusUnitsHelper.convertUnitwith those units.What did you expect to see?
tebibytesandkilobytes. The unit table listsTiBy -> tebibytesandkBy -> kilobytes. The "OTLP Metric points to Prometheus / Metric Metadata" section that references it is marked Status: Stable and says the unit MUST be converted using that table.What did you see instead?
tibibytes, andkByleft unconverted askBy. Both come from the static initializer ofPrometheusUnitsHelper(exporters/prometheus/src/main/java/io/opentelemetry/exporter/prometheus/PrometheusUnitsHelper.java, lines 41-42).What version and what artifacts are you using?
Artifacts: opentelemetry-exporter-prometheus (alpha)
Version: main @ 3a9fdc6
How did you reference these artifacts? N/A
Environment
Compiler: Temurin 21
OS: N/A
Additional context
This changes exposed metric names (
..._tibibytes->..._tebibytes). The existing test assertingtibibytesencodes the same mistake, so it has to be corrected too. Upstreamprometheus/otlptranslatoralready fixed both entries, keeping the old spellings in an opt-outlegacyUnitMap.