Hi all! A few months ago I posted an issue about a Prometheus "metrics linting tool", and I've finally submitted an initial PR for it.
https://github.com/prometheus/prometheus/issues/1953https://github.com/prometheus/prometheus/pull/2605There is more context in the issue and PR itself, but the idea is that this tool can be used to inspect metric names, labels, metadata, and types, for common issues.
Some example checks could be:
- use of non-base units: microseconds instead of seconds
- no help text for a metric
- use of "_total" suffix for non-counter metrics
If you have more suggestions for this tool, please do share your thoughts in this thread and/or on GitHub.
Here's an example of its use, pointed at the Prometheus server on my LAN:
http_request_duration_microseconds: use base unit "seconds" instead of "microseconds
Thanks for your time!
- Matt