Skip to content
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

Append unit to prometheus metric names #4390

Closed
jack-berg opened this issue Apr 18, 2022 · 6 comments · Fixed by #5400
Closed

Append unit to prometheus metric names #4390

jack-berg opened this issue Apr 18, 2022 · 6 comments · Fixed by #5400
Assignees

Comments

@jack-berg
Copy link
Member

jack-berg commented Apr 18, 2022

The spec requires that unit be appended to the metric name as a suffix. We don't do that anywhere today. I believe that would represent a breaking behavior change for prometheus users as their metric names would change when unit is present.

Still, would be good to do that soon to minimize the impact.

Originally posted by @jack-berg in #4386 (comment)

@jack-berg
Copy link
Member Author

Related spec issue.

@psx95
Copy link
Contributor

psx95 commented Dec 7, 2022

I would like to take this up, if that's ok.
@jack-berg could you assign this to me ?

@psx95
Copy link
Contributor

psx95 commented Dec 16, 2022

Just to confirm, since the link in the original description is broken, Prometheus and OpenMetrics Compatibility is the portion of the spec that needs to be followed to address this issue, correct ?

@dashpole
Copy link
Contributor

That is correct. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/compatibility/prometheus_and_openmetrics.md#metric-metadata-1 for unit guidance.

@psx95
Copy link
Contributor

psx95 commented Dec 22, 2022

Based on the semantic conventions in the spec document, I just wanted to confirm as to what should be the approach if user has a unit named {packets}, we cannot append this to the metric name, since it would violate the regex defined in the spec.

So in this case, we do drop the unit altogether, meaning no-op, is this correct ?

@dashpole
Copy link
Contributor

dashpole commented Jan 3, 2023

That is considered unitless in prometheus, so we should drop units (at the portion within the brackets) with {}. I'll update the spec to more fully describe the mapping.

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 a pull request may close this issue.

3 participants