Check Prometheus exported metrics

Use Docker to check metrics are correctly exposed for scraping

Published: Wednesday, May 19, 2021 Last modified: Wednesday, Oct 2, 2024

/metrics format reference

$ curl -s http://192.168.1.5:9115/metrics | docker run -i --entrypoint=promtool prom/prometheus check metrics --
$ curl -s http://192.168.1.5:9115/WRONG | docker run -i --entrypoint=promtool prom/prometheus check metrics --
error while linting: text format parsing error in line 1: invalid metric name