fix: correct UCUM units for TiBy and kilobytes in unitMap#66
fix: correct UCUM units for TiBy and kilobytes in unitMap#66Naman-B-Parlecha wants to merge 6 commits into
Conversation
Signed-off-by: Naman-B-Parlecha <naman.parlecha@finalroundai.com> Signed-off-by: Naman-B-Parlecha <namanparlecha@gmail.com>
Signed-off-by: Naman-B-Parlecha <namanparlecha@gmail.com>
|
PTAL @ArthurSens @dashpole |
aknuds1
left a comment
There was a problem hiding this comment.
@Naman-B-Parlecha @dashpole Some questions:
- Won't we need to update the tebibytes spelling simultaneously also in opentelemetry-collector-contrib?
- Won't renaming "tibibytes" metrics units to "tebibytes" be a backwards compatible change in Prometheus, that might break things for users?
- If we stop supporting "KBy" as an OTLP unit, won't that silently break support for producers sending the "KBy" spelling?
- Won't we need to update the "KBy" spelling simultaneously also in opentelemetry-collector-contrib?
|
Sure. I'm OK keeping KBy for backwards-compatibility. We can also coordinate the update to the collector. FYI @Naman-B-Parlecha that is here: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/138fbe1878d1b8c8bd31e3c942ec0d34e08c0c87/pkg/translator/prometheus/unit_to_ucum.go#L24 |
|
Thanks @dashpole - WDYT about my concern that renaming "tibibytes" metrics units to "tebibytes" will be a backwards compatible change in Prometheus, potentially breaking things for users though? |
Worth adding a warning log where this conversion happens in prometheus/prometheus for user visibility? |
|
I'm wondering whether this backwards compatible change should be possible to disable, e.g. for configurability from Grafana Mimir. As for Prometheus itself, maybe the old behaviour should be enabled until v4? As backwards incompatible changes shouldn't be made until the next major version (of Prometheus). @dashpole @Naman-B-Parlecha. |
Signed-off-by: Naman-B-Parlecha <namanparlecha@gmail.com>
|
Hmmmm, while I understand the potential negative effect, I'm not sure the units being changed are popular enough for us to be THIS careful. I can see kylobytes being used somehow (and we're keeping the backward compatible behavior), but Tebibytes? 😅 I don't think this is used by any Prometheus exporter, and it's not part of any semantic conventions in OTel either. The only way this is used is when someone creates a custom metric and intentionally measures things in Terabytes. There are very few companies in the world that measure things on this scale. I'd be super happy if we could just do a patch release for this, but if you're feeling very strongly opinionated about this, we could do a 2.0. What do you think? |
|
@ArthurSens I'm not suggesting a major bump for otlptranslator, but potential configurability. I'm further suggesting that we might want to disable this new behaviour in Prometheus until v4, for backwards compatibility. It's a question from my side though, and I'd like feedback from other maintainers. As for Grafana Mimir, the configurability could be good to have to protect users from potential metric renames. |
|
I'm not that worried about this this breaking users. I think this is a case where it is clearly a bug fix, and unlikely to have a significant negative impact. If upstream projects want configurability, it should be pretty easy for them to add special handling for TiBy prior to calling into this library to preserve existing behavior. I would probably advocate for using a feature gate to allow users to temporarily revert back to the old name (and provide feedback, if necessary) for a period of time. |
|
@dashpole That's what I'm suggesting too. We already have precedence for such configuration parameters in otlptranslator, see:
@Naman-B-Parlecha The above two are examples of configuration parameters controlling backwards compatible translation behaviour. |
|
Sure. Lets do that then |
…suffixes Signed-off-by: Naman-B-Parlecha <namanparlecha@gmail.com>
Signed-off-by: Naman-B-Parlecha <namanparlecha@gmail.com>
|
Hey @dashpole @aknuds1 @ArthurSens! one concern i have is naming currently added |
…capingWithUpdatedSuffixes Signed-off-by: Naman-B-Parlecha <namanparlecha@gmail.com>
|
@dashpole PTAL added two new strategies |
|
We shouldn't need a new strategy, right? Just booleans on the Namer structs (they should probably be "legacyUnitMapping" or something like that so that the default value of false uses the new behavior). |
Fixes two incorrect UCUM unit mappings as mentioned in #65
TiByshould map totebibytesand nottibibyteskilobytesshould map tokByand notKBy