管理 API

Prometheus 提供了一组管理 API,以方便自动化和集成。

健康检查

GET /-/healthy
HEAD /-/healthy

此端点始终返回 200,应用于检查 Prometheus 健康状况。

就绪检查

GET /-/ready
HEAD /-/ready

当 Prometheus 准备好服务流量(即响应查询)时,此端点返回 200。

重载

PUT  /-/reload
POST /-/reload

此端点触发 Prometheus 配置和规则文件的重载。默认情况下禁用,可以通过 --web.enable-lifecycle 标志启用。

或者,可以通过向 Prometheus 进程发送 SIGHUP 来触发配置重载。

退出

PUT  /-/quit
POST /-/quit

此端点触发 Prometheus 的优雅关闭。默认情况下禁用,可以通过 --web.enable-lifecycle 标志启用。

或者,可以通过向 Prometheus 进程发送 SIGTERM 来触发优雅关闭。

本文档是开源的。请通过提交 issues 或 pull requests 来帮助改进它。