Prometheus 热加载配置
-
先使用下面的命令访问prometheus查看是否正常
curl -X POST http://localhost:9090/-/reload
-
请求接口后返回
Lifecycle API is not enabled
. 就是没有开启热更新配置 ,需在启动命令增加参数:--web.enable-lifecycle
-
具体启动命令
./prometheus --web.enable-lifecycle --config.file=prometheus.yml
使用容器部署prometheus中,可以在运行参数中加入 --web.enable-lifecycle