如何检查我的 prometheus.yml 有没有错误?

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

我正在使用 windows 安装普罗米修斯,我确实添加了 job_name:'node_exporter'。 我想在重新启动之前检查我的 prometheus.yml 是否有任何错误?

导航到 Prometheus 文件夹后,在 windows 中键入以下命令。

promtool check config prometheus.yml

如果没有错误输出将是

如果您正在使用 Ubuntu,并且当前在不同的词典中,请键入

  promtool check config /etc/prometheus/prometheus.yml

如果你想重启

sudo service prometheus restart