May 2019
Intermediate to advanced
442 pages
11h 36m
English
The check metrics subcommand validates whether the metrics passed to it follow the Prometheus guidelines in terms of consistency and correctness. This can be useful in the development cycle to make sure new instrumentation conforms to the standard, as well as using it in automation if you have some control over whether new jobs follow the same rules. It expects the metrics payload as input via STDIN, so you can pipe either a file or, the output of curl directly into it. For the sake of this example, we are exposing an issue that occurred in Prometheus prior to version 2.8.0:
~$ curl -s http://prometheus:9090/metrics | promtool check metricsprometheus_tsdb_storage_blocks_bytes_total non-counter metrics should not have "_total" ...
Read now
Unlock full access