【问题标题】:Prometheus: Configure multiple label selectors for kubernetes_sd_configsPrometheus:为 kubernetes_sd_configs 配置多个标签选择器
【发布时间】:2022-11-10 03:46:23
【问题描述】:

我想用 Kubernetes Service Discovery 配置 Prometheus 并按标签过滤 pod。

不幸的是,以下方法不起作用:

kubernetes_sd_configs:
- role: pod
  selectors:
  - role: pod
    label: "app=MyApp"
  - role: pod
    label: "type=client"

我收到一个错误:

"Error loading config (--config.file=/etc/prometheus/prometheus.yml)" file=/etc/prometheus/prometheus.yml err="parsing YAML file /etc/prometheus/prometheus.yml: duplicated selector role: pod"

是否可以配置多个标签选择器?

【问题讨论】:

    标签: prometheus


    【解决方案1】:

    面对同样的问题,你是否找到了解决 kubernetes_sd_configs 的多个标签选择器的方法?

    【讨论】:

      猜你喜欢
      • 2020-08-19
      • 1970-01-01
      • 2022-01-02
      • 2022-12-17
      • 1970-01-01
      • 2022-10-09
      • 2021-11-22
      • 2010-10-17
      • 2019-05-15
      相关资源
      最近更新 更多