Pcornel
Browse topics
Options
Recent
Favorites
Observability · Technical reference

Host Metrics with node_exporter

Direct answer

node_exporter exposes Linux host metrics — CPU, memory, disks, filesystems, network, load — on port 9100 for Prometheus.

When to use this

Use it to monitor Linux hosts.

First 30 seconds

1. Up: curl -s localhost:9100/metrics | grep node_load1.

2. CPU busy: 1 - avg by (instance)(rate(node_cpu_seconds_total{mode="idle"}[5m])).

3. Memory: node_memory_MemAvailable_bytes.

4. Disk fill: node_filesystem_avail_bytes.

5. Network errors: node_network_receive_errs_total.

Operational verification

kernel /proc,/sys → node_exporter → scrape → dashboards/alerts

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
OpenTelemetry / Prometheus / Grafana / common metrics-log-trace pipelines
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformOpenTelemetry / Prometheus / Grafana / common metrics-log-trace pipelines
Scope / prerequisiteUse it to monitor Linux hosts.
What next?2 suggested next steps
Evidence0
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 How to verify Verify boundary

Compare node_exporter values with top, free and df on the host. Alert on filesystem space and disk saturation.

Step 2 Common failures Narrow the fault

Monitoring MemFree instead of MemAvailable causes false alarms. Including tmpfs and overlay filesystems adds noise. Running the exporter in a container without host mounts reports container values.

Key points

Use rate() on CPU and network counters. Exclude pseudo filesystems. Enable the textfile collector for custom host metrics.

Key checks
  • curl -s localhost:9100/metrics | grep node_load1 — first check for this topic
  • curl -s localhost:9090/-/ready — Prometheus ready
  • curl -s 'localhost:9090/api/v1/query?query=up' — scrape targets up/down
  • promtool check config prometheus.yml — config valid
ReferenceWhat it is1 section · depth on demand

How it works

node_exporter reads /proc and /sys on each scrape. Collectors can be enabled or disabled with flags. The textfile collector exposes custom metrics written by scripts.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

The queries most host dashboards need

# CPU busy %, per instance
100 * (1 - avg by (instance) (rate(node_cpu_seconds_total{mode="idle"}[5m])))

# Memory actually available (not MemFree)
node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes

# Filesystem space left, real filesystems only
node_filesystem_avail_bytes{fstype!~"tmpfs|overlay|squashfs"} / node_filesystem_size_bytes

# Disk busy (utilisation) and average I/O wait per operation
rate(node_disk_io_time_seconds_total[5m])
rate(node_disk_read_time_seconds_total[5m]) / rate(node_disk_reads_completed_total[5m])

# Network throughput and errors
rate(node_network_receive_bytes_total{device!~"lo|veth.*"}[5m]) * 8
rate(node_network_receive_errs_total[5m])

# Pressure stall information (kernel 4.20+): share of time tasks waited
rate(node_pressure_cpu_waiting_seconds_total[5m])

Reading them correctly

MetricTrap
MemFreeLinux uses free memory for cache; low MemFree is normal — use MemAvailable
Load averageIncludes tasks in uninterruptible I/O; compare with CPU count, and check PSI
io_time near 100 %On SSD/NVMe with parallel queues this does not mean saturated — look at latency
Filesystem % usedInodes can run out first: node_filesystem_files_free

Alerts that matter

predict_linear(node_filesystem_avail_bytes{fstype!~"tmpfs|overlay"}[6h], 4*3600) < 0   # full within 4 h
node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes < 0.05
increase(node_vmstat_oom_kill[15m]) > 0
node_timex_offset_seconds > 0.05 or node_timex_sync_status == 0

Running it

Run it as a systemd service on hosts, or as a DaemonSet with hostNetwork, hostPID and the host root mounted read-only (--path.rootfs=/host) in Kubernetes. Enable extra collectors deliberately (--collector.systemd, --collector.processes) and use the textfile collector for site-specific metrics such as backup age.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Common mistakes

  • Scraping node_exporter without filesystem/collector filters.
ReferenceConfiguration & state1 section · depth on demand

Setup and key metrics

node_exporter --collector.systemd --collector.textfile.directory=/var/lib/node_exporter
curl -s localhost:9100/metrics | grep node_load1
QueryShows
1 - avg by (instance)(rate(node_cpu_seconds_total{mode="idle"}[5m]))CPU use
node_memory_MemAvailable_bytes / node_memory_MemTotal_bytesFree memory ratio
node_filesystem_avail_bytes{fstype!~"tmpfs"}Free disk
rate(node_disk_io_time_seconds_total[5m])Disk busy
rate(node_network_receive_errs_total[5m])NIC errors
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
host metrics with node_exporternode_exporter host metricslinux server monitoring
Confirmation

Confirm action

Continue?