Difference between revisions of "/var/lib/prometheus/node-exporter/"

From wikieduonline
Jump to navigation Jump to search
(Created page with " /var/lib/prometheus/node-exporter/ {{node exporter}}")
 
Line 1: Line 1:
 
  /var/lib/prometheus/node-exporter/
 
  /var/lib/prometheus/node-exporter/
 +
 +
<pre>
 +
/var/lib/prometheus/node-exporter# cat README.textfile
 +
Textfile Collector
 +
 +
The textfile collector is similar to the Pushgateway, in that it allows
 +
exporting of statistics from batch jobs. It can also be used to export static
 +
metrics, such as what role a machine has. The Pushgateway should be used for
 +
service-level metrics. The textfile module is for metrics that are tied to a
 +
machine.
 +
 +
To use it, create files in this directory that are readable by the prometheus
 +
user.  The collector will parse all files in matching the glob *.prom using the
 +
text format.
 +
 +
To atomically push completion time for a cron job:
 +
 +
echo my_batch_job_completion_time $(date +%s) > \
 +
    /var/lib/prometheus/node-exporter/my_batch_job.prom.$$
 +
mv /var/lib/prometheus/node-exporter/my_batch_job.prom.$$ \
 +
    /var/lib/prometheus/node-exporter/my_batch_job.prom
 +
 +
To statically set roles for a machine using labels:
 +
 +
echo 'role{role="application_server"} 1' > \
 +
    /var/lib/prometheus/node-exporter/role.prom.$$
 +
mv /var/lib/prometheus/node-exporter/role.prom.$$ \
 +
    /var/lib/prometheus/node-exporter/role.prom
 +
 +
</pre>
  
  
 
{{node exporter}}
 
{{node exporter}}

Revision as of 06:18, 26 December 2023

/var/lib/prometheus/node-exporter/
/var/lib/prometheus/node-exporter# cat README.textfile
Textfile Collector

The textfile collector is similar to the Pushgateway, in that it allows
exporting of statistics from batch jobs. It can also be used to export static
metrics, such as what role a machine has. The Pushgateway should be used for
service-level metrics. The textfile module is for metrics that are tied to a
machine.

To use it, create files in this directory that are readable by the prometheus
user.  The collector will parse all files in matching the glob *.prom using the
text format.

To atomically push completion time for a cron job:

echo my_batch_job_completion_time $(date +%s) > \
    /var/lib/prometheus/node-exporter/my_batch_job.prom.$$
mv /var/lib/prometheus/node-exporter/my_batch_job.prom.$$ \
    /var/lib/prometheus/node-exporter/my_batch_job.prom

To statically set roles for a machine using labels:

echo 'role{role="application_server"} 1' > \
    /var/lib/prometheus/node-exporter/role.prom.$$
mv /var/lib/prometheus/node-exporter/role.prom.$$ \
    /var/lib/prometheus/node-exporter/role.prom


Prometheus, Prometheus Node exporter, /etc/default/prometheus-node-exporter, node_exporter.arg

Advertising: