-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expand the set of units supported by the prometheus exporter #4374
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #4374 +/- ##
=====================================
Coverage 83.4% 83.4%
=====================================
Files 184 184
Lines 14380 14380
=====================================
Hits 11997 11997
Misses 2155 2155
Partials 228 228
|
duplicate unit suffixes
Opportunistic question: Should we add some doc comments to https://pkg.go.dev/go.opentelemetry.io/otel/metric#WithUnit that we recommend using UCUM units? Related to #4374 (comment) |
Doing so in a separate PR sounds good to me. |
**Description:** Discovered during open-telemetry/opentelemetry-go#4374 (review). `B` means `bel` in UCUM, so MB is `megabel`, for example. `$` is also not UCUM. https://ucum.org/ucum#section-Alphabetic-Index-By-Symbol
Fixes #4372.
We currently have a very small set of units we recognize. Expand it so that we can cover more cases, such as the one pointed out in the issue.
Change the tests to use seconds instead of milliseconds, as we want to ensure that case works correctly.
The set of units is copied from https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/pkg/translator/prometheus/normalize_name.go#L19