Node Exporter is a Prometheus exporter for hardware and OS metrics exposed by *NIX kernels. It provides detailed insights into system-level resources including CPU, memory, disk, network, and more. In our architecture, Node Exporter serves as the primary source of infrastructure metrics, enabling effective resource monitoring and capacity planning.
We’ve configured Node Exporter as follows:
node-exporter:
<<: *common
image: prom/node-exporter:latest
container_name: node-exporter
profiles: ["grafanaprofile"]
ports:
- "9101:9100"
logging:
driver: gelf
options:
gelf-address: "udp://${LOG_HOST}:12201"
tag: "node-exporter"
healthcheck:
test: ["CMD-SHELL", "wget -q --spider http://localhost:9100/metrics || exit 1"]
interval: 30s
timeout: 10s
retries: 5
prom/node-exporter
image for reliable metrics collectionwget
instead of curl
since the Node Exporter container doesn’t have curl installed, checking that the metrics endpoint is functioning properlyNode Exporter is configured as a scrape target in Prometheus:
scrape_configs:
- job_name: "node"
static_configs:
- targets: ["node-exporter:9100"]
This allows Prometheus to automatically collect all system metrics exposed by Node Exporter.
Node Exporter exposes hundreds of metrics across several categories:
Category | Description | Example Metrics |
---|---|---|
CPU | Processor usage and statistics | node_cpu_seconds_total , node_load1/5/15 |
Memory | RAM usage and allocation | node_memory_MemAvailable_bytes , node_memory_MemFree_bytes |
Disk | Storage usage and I/O | node_filesystem_free_bytes , node_disk_io_time_seconds_total |
Network | Interface traffic and errors | node_network_receive_bytes_total , node_network_transmit_errors_total |
System | Uptime, process counts | node_time_seconds , node_procs_running |
For optimal visualization, we use the official Node Exporter dashboard in Grafana (Dashboard ID: 1860). This dashboard provides comprehensive views of:
To import this dashboard:
You can access raw metrics at:
http://localhost:9101/metrics
This endpoint returns all available metrics in Prometheus format, useful for debugging or exploring available metrics.
While we use the default configuration, Node Exporter can be customized with various flags:
command:
- '--collector.filesystem.ignored-mount-points=^/(sys|proc|dev|host|etc)($|/)'
- '--collector.textfile.directory=/node_exporter/textfile_collector'
Common customizations include:
In production environments, consider:
If metrics aren’t appearing in Prometheus:
docker compose ps node-exporter
curl http://localhost:9101/metrics
http://localhost:9090/targets
docker compose logs node-exporter