gpt4 book ai didi

prometheus - 从 Prometheus 中删除指标会产生错误 : not implemented

转载 作者:行者123 更新时间:2023-12-03 22:32:19 25 4
gpt4 key购买 nike

我想删除时间序列的所有指标 mymetricname{foo="bar"}在 Prometheus 2.0.0-beta.2 安装中。

我目前从这个对 HTTP API 的调用中收到一条错误消息。 :

curl -X DELETE -g \
'http://localhost:9090/api/v1/series?match[]=mymetricname{foo="bar"}'

{"status":"error","errorType":"internal","error":"not implemented"}

但随后是 statement来自 author显然,这种类型的调用在很久以前(早在 2015 年)就成为可能。这里发生了什么?

更新 问题似乎不太可能是由 URL 中的错误转义字母引起的,因为以下工作正常:
curl -X GET -g \
'http://localhost:9090/api/v1/series?match[]=mymetricname{foo="bar"}'

{"status":"success","data":[<data>]}

最佳答案

在 Prometheus 2.0 中,端点已移动到一个 POST,主体位于 /api/v2/admin/tsdb/delete_series
例如:

curl -XPOST -g 'http://localhost:9090/api/v2/admin/tsdb/delete_series' -d '{"matchers": [{"name": "__name__", "value": "up"}]}'

关于prometheus - 从 Prometheus 中删除指标会产生错误 : not implemented,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47034147/

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