热加载配置

有两种方式:

  • 查看Prometheus的进程id,发送 SIGHUP。kill -HUP processID
  • 发送一个POST请求到 /-/reload,需要在启动时给定 —web.enable-lifecycle。curl -X POST http://localhost:9090/-/reload

参考官方文档CONFIGURATION内容:

Prometheus can reload its configuration at runtime. If the new configuration is not well-formed, the changes will not be applied. A configuration reload is triggered by sending a SIGHUP to the Prometheus process or sending a HTTP POST request to the /-/reload endpoint (when the —web.enable-lifecycle flag is enabled). This will also reload any configured rule files.

参考