gpt4 book ai didi

Prometheus指标删除后不消失

转载 作者:行者123 更新时间:2023-12-04 17:34:40 26 4
gpt4 key购买 nike

我需要删除一些源自一台主机的 Prometheus 指标。为简单起见,我们假设需要删除主机的所有指标。

对两个 VM 上的 delete_series 端点执行 POST。按预期得到 204。指标没有消失(在网络/浏览器界面中仍然可见,即使在通过 CTRL+RCTRL+F5 强制刷新缓存后也是如此)。

还尝试强制 clean_tombstones,得到 204,但没有改变。

重新启动了两个实例,然后还等待了一天,希望“某物”能够自行重新加载。

使用的命令:# curl -X POST -g 'http://localhost:9090/api/v1/admin/tsdb/delete_series?match[]={instance="my-hostname"}' -v

# curl -X POST -g 'http://localhost:9090/api/v1/admin/tsdb/clean_tombstones' -v

输出:

*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 9090 (#0)
> POST /api/v1/admin/tsdb/delete_series?match[]={instance="my-hostname"} HTTP/1.1
> Host: localhost:9090
> User-Agent: curl/7.47.0
> Accept: */*
>
< HTTP/1.1 204 No Content
< Access-Control-Allow-Headers: Accept, Authorization, Content-Type, Origin
< Access-Control-Allow-Methods: GET, OPTIONS
< Access-Control-Allow-Origin: *
< Access-Control-Expose-Headers: Date
< Date: Tue, 23 Jul 2019 07:54:30 GMT
<
* Connection #0 to host localhost left intact

我的 Prometheus 集群由两个运行 Prometheus 2.6.1 的虚拟机组成。

admin-api 已启用:

           └─28557 /opt/prometheus/prometheus-server/prometheus --config.file=/etc/prometheus/prometheus.yml --storage.tsdb.path=/data/prometheus/databases --storage.tsdb.retention=15d --web.enable-admin-api --web.external-url=http://redacted --log.level=debug

最佳答案

经过进一步检查,发现源主机上的 /var/spool/prometheus 目录中存在意外的节点导出器文件,导致节点导出器重新抓取 古老的指标一遍又一遍。删除文件并重新运行删除命令后,指标消失了。

关于Prometheus指标删除后不消失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57160635/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com