我在k8s上部署了prometheus-operator,并且想利用node-exporter采集节点的标签,来区分不同的项目组,进而实现alert告警等功能。
于是我给节点打了一个标签:team:backend
nodeExporter:
relabelings:
- sourceLabels: [__meta_kubernetes_pod_node_name]
separator: ;
regex: ^(.*)$
targetLabel: nodename
replacement: $1
action: replace
- sourceLabels: [__meta_kubernetes_node_labelpresent_team]
separator: ;
regex: ^(.*)$
targetLabel: team
replacement: $1
action: replace
运行后我发现 - sourceLabels: [__meta_kubernetes_node_labelpresent_team]这一段配置并没有生效,标签team并没有采集到,请问我的配置是有问题吗?
我找了官网,但是没有说明,官网是https://prometheus.io/docs/prometheus/latest/configuration/configuration/#kubernetes_sd_config
我想要实现node-exporter上报的数据含有team这个标签
不能多个sourceLabels吧,没玩过,学习下