【问题标题】:How to set --collector.textfile.directory in node exporter如何在节点导出器中设置 --collector.textfile.directory
【发布时间】:2021-09-15 18:41:39
【问题描述】:
我正在关注this 关于使用文本文件收集器导出指标的文章。
我创建了一个文本文件/var/lib/node_exporter/textfile_collector/directory_size.prom,其中包含目录大小的指标,但它不会将其推送到 prometheus。
我读到标志--collector.textfile.directory 负责读取目录的路径。如何查看采集器的目录是什么,如何更改?
【问题讨论】:
标签:
prometheus
prometheus-node-exporter
【解决方案1】:
必须添加的node_exporter服务文件
--collector.textfile.directory=/var/lib/node_exporter/textfile_collector
例子:
[Unit]
Description=Node Exporter
After=network.target
[Service]
Type=simple
ExecStart=/path/binary/node_exporter --collector.textfile.directory=/path/to/read/directory
[Install]
WantedBy=multi-user.target