-
Notifications
You must be signed in to change notification settings - Fork 881
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
Reconsider modifying metric name with OTLP unit #2497
Comments
@open-telemetry/wg-prometheus |
The prometheus metric would ideally be named We could consider making it a "MUST, by default", rather than just a "MUST", to allow users the option of excluding the unit. According to OpenMetrics, if we add a unit comment (which we really should IMO), we MUST add the unit as the metric suffix as well. |
Thanks I was looking for the text in OpenMetrics but couldn't find it. It looks like it should be added then, wonder if OTel's default of ms vs seconds will cause issues for users though |
Yeah, a metric ending in |
We'd have to maintain a table of origin units, target units, and conversion functions. Could probably have a smallish library of common situations that would cover the majority of use cases. Ideally this would be spec'd. Histograms are a bit tricky. Suppose you have an instrument aggregated as explicit bucket with the default bucket boundaries |
Scaling all sum + bucket boundaries seems like the best in the histogram case. The only case where I don't think it works correctly is for exponential histograms. IIUC, bucket boundaries are powers of 2, so we can change the scale by 1024 (2^10), but not exactly 1000. |
It's not clear to me how exponential histograms would be converted to prometheus in general. Are exponential histograms allowed to be exported via prometheus? If yes, would the exponential bucket boundaries just be computed and converted explicit buckets? If yes, can we just scale the boundaries ignoring the fact that they were originally an exponential scale? |
One of the prometheus maintainers is working on support for exponential histograms in prometheus, but i'm not sure what the plan is or how far along they are. For now, the Prometheus <-> OTLP spec says to drop exponential histogram points, so you are correct that it isn't an issue right now. |
Hi, we expect the metrics to come with an unit: Its a bit unfortunate that OTel is using With these two cases above, I think it makes more sense to include the unit as it will become very obvious what it is when writing the query and obvious if metrics with two different units are being used together. |
Regarding exponential histograms, I think we'll have to just live with the inconsistency between |
I've written a proposal related to this, which proposes not adding unit to the metric name when translating from OTel to prometheus: https://docs.google.com/document/d/16Wo-QHZLcKO0uFx97HPUJ-ZMFXSPviQ7Oc4-bShgcto/edit?usp=sharing Feedback is welcome. It would be especially helpful if you have any feedback from users one way or another. I'm hoping to discuss it at the next Prometheus dev summit on 2/22. |
@dashpole do you have any feedback you want to share on this? |
@dashpole please take a look |
The prometheus conversion currently requires metric names to be modified with the OTLP unit
I think this should be reconsidered, I suspect users don't expect their metric names to not actually be the names, and e.g. when configuring grafana
http_server_duration
seems expected vshttp_server_duration_ms
. Adding UNIT to the help text makes sense though.The text was updated successfully, but these errors were encountered: