Custom Metrics cannot be Collected by Node-exporter in Docker Environment

170 views
Skip to first unread message

Athena L

unread,
Mar 26, 2023, 2:27:07 AM3/26/23
to Prometheus Users
Hello all,

I guess this is a question more related to node-exporter. I'm following a online tutorial on how to monitor cron job execution status using Prometheus, Grafana, and node_exporter. https://janikvonrotz.ch/2020/09/07/monitor-cron-jobs-with-prometheus-grafana-and-node-exporter/ I have successfully generated metric files to the directory /var/temp, and my locally installed node_exporter can detect these metrics, specifically the "node_cron_job_exit_code" metric, which is visible on 9100/metrics. However, when I tried to move everything to a Docker environment using docker-compose to run node-exporter and Prometheus containers simultaneously, the metric is no longer visible on 9100/metrics. I added the command "--collector.textfile.directory=/hostfs/var/tmp" to the node-exporter service in the docker-compose.yml file, and the metric files are still generated in the /var/tmp directory. However, even though all the other metrics are present, I cannot locate the "node_cron_job_exit_code" metric on 9100/metrics. Does anyone know what might be the issue here?

Thank you!
Reply all
Reply to author
Forward
0 new messages