通过deployment采集组件指标,没有ident和添加的标签,daemonset采集的信息是正常的。

Viewed 71

n9e版本 v6.0.0-ga.13,categraf版本 v0.3.18
yaml中configmap的config.toml配置是一样的,这种可能是什么原因。
hostname = "$HOSTNAME-$HOSTIP"

1689211446866.png
1689211515459.png

1 Answers

deployment用的是prometheus-agent , 配置主要是 prometheus.toml 和 scrape的yaml ,可以查看对应的configmap,(如果用了k8s目录下的yaml,对用的configmap是categraf-config和scrape-config)
daemonset用的是input.prometheus插件,配置主要是config.toml和input.prometheus/prometheus.toml ,这个是带了ident(agent_hostname)的

scrape的yaml

修改了deployment.yaml中categraf-config下的config.toml。这两个标签都没生效,是不是还有别的地方需要调整。

还是说deployment采集的,需要修改prometheus.toml来添加标签?