【发布时间】: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