我试图限制node_exporter收集度量标准的系统单元,我在正则表达式上遇到了麻烦。我使用grafana-server.service作为主机上的测试,但导出程序在介绍regex时没有报告任何指标。我尝试过多种格式,但无法理解,这是我目前正在尝试的ATM机:
ExecStart=/opt/node_exporter/node_exporter --collector.systemd.unit-include "(grafana|ssh)\.service" --collector.filesystem.ignored-mount-points "^/(sys|proc|dev|run|boot|host|etc)($|/)" $ARGS
文件系统收集器regex正在工作,顺便说一下。我搞砸了有什么线索吗?
我的感谢
发布于 2022-03-30 06:47:48
我也有过同样的问题。我通过像这样配置服务(与您的情况相适应的名称)来实现它:
ExecStart=/opt/node_exporter/node_exporter --collector.systemd --collector.systemd.unit-include=(grafana|ssh).service完成此操作后,请记住通过systemctl守护进程重新加载配置--重新加载并重新启动节点导出程序。在我的配置完成这些步骤之后,当我检查指标时,我只得到我想要的进程。希望它能帮上忙
https://stackoverflow.com/questions/71495086
复制相似问题