在 Prometheus 中删除标签

Deleting labels in Prometheus

我正在使用 Prometheus 进行一些监控,但我似乎找不到删除不再需要的标签的方法。我尝试使用 DELETE /api/v1/series 端点,但它没有将其从 Prometheus Graph 主页面的下拉列表中删除。有没有办法在不从头开始的情况下将它们从下拉列表中删除?

谢谢

如果您删除所有相关时间序列,则不应再返回它。如果不是这种情况,请提交错误。

这也发生在我身上,尝试在查询标签值时包含指标名称,如下所示:

    label_values(node_load1, instance)

参考:http://docs.grafana.org/features/datasources/prometheus/

Prometheus 不提供删除特定标签的功能,因为这可能会导致重复具有相同标签集的时间序列。例如,假设 Prometheus 包含以下时间序列:

http_requests_total{instance="host1",job="foobar"}
http_requests_total{instance="host2",job="foobar"}

如果移除instance标签,那么这两个时间序列将变得相同:

http_requests_total{job="foobar"}
http_requests_total{job="foobar"}

现在 Prometheus 和用户都无法区分这两个时间序列。

Prometheus 仅提供 API 用于删除与给定 series selector - see these docs 匹配的时间序列以获取详细信息。