9.9 MB
6 months ago
All Layers
Find file
Last update
6 months ago
about 1 year ago
about 1 year ago
about 1 year ago
about 1 year ago
about 1 year ago
about 1 year ago
about 1 year ago
about 1 year ago

Node exporter

Prometheus exporter for machine metrics, written in Go with pluggable metric collectors.

Building and running

./node_exporter <flags>

Running tests

make test

Available collectors

By default the build will include the native collectors that expose information from /proc.

Which collectors are used is controlled by the --collectors.enabled flag.

Enabled by default

attributesExposes attributes from the configuration file. Deprecated, use textfile module instead.
diskstatsExposes disk I/O statistics from /proc/diskstats.
filesystemExposes filesystem statistics, such as disk space used.
loadavgExposes load average.
meminfoExposes memory statistics from /proc/meminfo.
netdevExposes network interface statistics from /proc/netstat, such as bytes transferred.
netstatExposes network statistics from /proc/net/netstat. This is the same information as netstat -s.
statExposes various statistics from /proc/stat. This includes CPU usage, boot time, forks and interrupts.
textfileExposes statistics read from local disk. The --collector.textfile.directory flag must be set.
timeExposes the current system time.

Disabled by default

bondingExposes the number of configured and active slaves of Linux bonding interfaces.
gmondExposes statistics from Ganglia.
interruptsExposes detailed interrupts statistics from /proc/interrupts.
lastloginExposes the last time there was a login.
megacliExposes RAID statistics from MegaCLI.
ntpExposes time drift from an NTP server.
runitExposes service status from runit.

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 set the --collector.textfile.directory flag on the Node exporter. The collector will parse all files in that directory 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) > /path/to/directory/my_batch_job.prom.$$
mv /path/to/directory/my_batch_job.prom.$$ /path/to/directory/my_batch_job.prom

To statically set roles for a machine using labels:

echo 'role{role="application_server"} 1' > /path/to/directory/role.prom.$$
mv /path/to/directory/role.prom.$$ /path/to/directory/role.prom