要通过命令请求 Prometheus API 删除一个 'check_marathon_status' 的所有数据,可以使用 curl 命令或类似的 HTTP 客户端工具。

首先,需要知道 Prometheus 的 API 地址和端口号。假设 Prometheus API 地址是 'http://localhost:9090'。

然后,使用以下 curl 命令发送一个 DELETE 请求来删除所有 'check_marathon_status' 的数据:

curl -X DELETE 'http://localhost:9090/api/v1/series' -d 'match[]={__name__="check_marathon_status"}'

这个命令会发送一个 DELETE 请求到 Prometheus 的 '/api/v1/series' 路径,并使用 'match' 参数指定要删除的数据系列的条件,即 'name' 等于 'check_marathon_status'。

请注意,这个命令将删除所有匹配条件的数据系列,包括所有标签的 'check_marathon_status'。确保你真的想要删除所有这些数据,因为这个操作是不可逆的。

如果请求成功,将会返回一个 HTTP 200 OK 响应。

请根据实际情况修改命令中的 Prometheus API 地址和端口号。

Prometheus API 删除数据系列:如何删除 check_marathon_status 数据

原文地址: https://www.cveoy.top/t/topic/pakW 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录