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

Do not set explicit unit on Prometheus 1.x Metadata #5038

Closed
jonatan-ivanov opened this issue May 3, 2024 · 0 comments
Closed

Do not set explicit unit on Prometheus 1.x Metadata #5038

jonatan-ivanov opened this issue May 3, 2024 · 0 comments
Labels
bug A general bug registry: prometheus A Prometheus Registry related issue
Milestone

Comments

@jonatan-ivanov
Copy link
Member

jonatan-ivanov commented May 3, 2024

We should not set Unit in the Metadata since if it is set, it must be a suffix of the MetricFamily name separated by an underscore (see OpenMetrics spec).

This can be problematic since Micrometer adds the unit to the name but not necessarily as a suffix. For example, Micrometer does this test_seconds_max but if Unit is present the name should be test_max_seconds. The difference is not having the invalid unit definition on the output (# UNIT test_seconds_max seconds) which would cause scraping errors on the server side (the Prometheus 0.x registry also does this).

@jonatan-ivanov jonatan-ivanov added bug A general bug registry: prometheus A Prometheus Registry related issue labels May 3, 2024
@jonatan-ivanov jonatan-ivanov added this to the 1.13.0 milestone May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A general bug registry: prometheus A Prometheus Registry related issue
Projects
None yet
Development

No branches or pull requests

1 participant