-
Notifications
You must be signed in to change notification settings - Fork 190
Prometheus: Add setting for recommended metric names #596
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
base: main
Are you sure you want to change the base?
Conversation
This commit adds a setting to PrometheusBuilder to add the '_total' suffix to counter names, compatible with [Prometheus naming best practices](https://prometheus.io/docs/practices/naming/). This is useful for migrating from the [prometheus-client] crate, (where the counter suffix is enforced) without breaking existing dashboards. [prometheus-client](https://docs.rs/prometheus-client/latest/prometheus_client/) Signed-off-by: Michel Heily <[email protected]>
👋🏻 I'd rather see this updated here:
Having two distinct settings for controlling metric name suffixes is too much. I think we would just add this for the |
Only See these lines from the above link:
If you don't want yet another setting, maybe we can have a |
Blah, sometimes I really dislike how prescriptive Prometheus is... 😅 Alright, yeah: I think what I ultimately want to work towards is being able to get rid of these opt-in ways of adding the unit suffixes, adding the Some thoughts:
Then in 0.19.0, I can remove |
Yep, Sounds good to me overall — I like the direction. My only concern is around deprecating or changing the default behavior too aggressively — there might be users who currently only enable unit suffixes, and if their dashboards are tied to that, it could be hard or even impossible for them to update (e.g. if the app is deployed to customers). If breaking changes are introduced - might be worth keeping a way to retain the current behavior, even if it's opt-in. |
I pushed the changes you suggested, and also had to fix some stuff in Mainly, the fix I made in 80960de could be breaking existing metric names for users who use unit-suffixes :/ |
This commit adds a setting to PrometheusBuilder to add the '_total' suffix to counter names, compatible with Prometheus naming best practices.
This is useful for migrating from the [prometheus-client] crate, (where the counter suffix is enforced) without breaking existing dashboards.
prometheus-client