promtool check-metrics + promlint

701 views
Skip to first unread message

Matt Layher

unread,
Apr 11, 2017, 4:48:34 PM4/11/17
to Prometheus Developers
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/1953
https://github.com/prometheus/prometheus/pull/2605

There 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:

$ curl -s http://192.168.1.3:9090/metrics | promtool check-metrics
http_request_duration_microseconds: use base unit "seconds" instead of "microseconds

Thanks for your time!
- Matt

Fabian Reinartz

unread,
Apr 12, 2017, 3:28:05 AM4/12/17
to Matt Layher, Prometheus Developers
Great initiative! Thanks for doing this.

--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-devel...@googlegroups.com.
To post to this group, send email to prometheus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/96ad438c-589b-4183-90d9-25b5fc324b28%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages