【问题标题】:Relabeling/Keeping in Prometheus在 Prometheus 中重新标记/保存
【发布时间】:2021-08-20 06:50:13
【问题描述】:

设置

  - job_name: "tse"
    http_sd_configs:
      - url: "http://tse.mydomain.url/something"
        basic_auth:
          username: "foo"
          password: "bar"
    metric_relabel_configs:
      - source_labels: [__param_fccid]
        regex: (.*)
        target_label: fccid
        replacement: ${1}

问题

在 Prometheus 中,我看到端点被抓取,并且端点包含fccid 参数。但是该参数未写入/保留为标签。 我从昨天开始尝试不同的东西(labelkeep、keep、replace、labelmap、relabel_configs),但没有任何效果。

metric_relabel_configs 是否不适用于 http_sd_configs

【问题讨论】:

  • 你试过__meta_fccid而不是__param_fccid吗?
  • @MichaelHausenblas:我试过了。不用找了。在 prometheus 的“Targets”页面中的“Labels”列中,参数写为"__param_fccid"="12"

标签: regex prometheus monitoring


【解决方案1】:

我找到了答案。我不得不使用relabel_configs 而不是metric_relabel_configs

谢谢@Michael Hausenblas。我正在尝试第一个已知的参数和配置(互联网)来采用它。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-04-03
    • 2022-01-02
    • 2021-01-21
    • 2018-09-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多