gpt4 book ai didi

prometheus - 有没有办法使用度量/标签值从 pushgateway 中删除?

转载 作者:行者123 更新时间:2023-12-04 13:55:28 28 4
gpt4 key购买 nike

我只看到如何使用 'curl -X DELETE http://localhost:9091/metrics/job/some_job/instance/some_instance' 从 pushgateway 中删除,但我想删除包含特定标签值的指标,我该怎么做那?
更新:
我正在使用 python 编写脚本,prometheus 有一个带有函数“delete_from_pushgateway()”的 python 客户端
这可以在以下位置找到:https://github.com/prometheus/client_python

最佳答案

根据 Prometheus Gateway README

  • 删除由 {job="some_job",instance="some_instance"} 标识的组中的所有指标:
    curl -X 删除 http://pushgateway.example.org:9091/metrics/job/some_job/instance/some_instance
  • 删除由 {job="some_job"} 标识的组中的所有指标(请注意,这不包括上一个示例中 {job="some_job",instance="some_instance"} 组中的指标,即使这些指标具有相同的工作标签):
    curl -X 删除 http://pushgateway.example.org:9091/metrics/job/some_job
  • 关于prometheus - 有没有办法使用度量/标签值从 pushgateway 中删除?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63257221/

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