How to check my prometheus.yml has errors or not?

Viewed 374

I'm using windows installation of Prometheus and I did add a job_name: 'node_exporter'. I wanna check that my prometheus.yml has any errors or not prior to restarting ?

1 Answers

For that in windows type below command after navigating to Prometheus folder.

promtool check config prometheus.yml

If there are no errors output will be

enter image description here

If you are using Ubuntu, and currently in different dictionary, type

  promtool check config /etc/prometheus/prometheus.yml

If you wish to restart

sudo service prometheus restart
Related