LinuxXLVI · OpenTelemetryOTel host receiver
OTel host receiver and process metrics
What you'll learn
- Use the OTel host receiver
- Use the hostmetrics process scraper for per-process metrics
- Configure the agent to scrape host metrics
- Validate a collector config before rolling it out
- Replace node_exporter with the OTel approach
Prerequisites
Verified against Ubuntu 24.04 LTS · Debian 12 (Bookworm) · RHEL 9.x · Rocky Linux 9.x · AlmaLinux 9.x · Linux kernel 6.1 LTS / 6.6 LTS · systemd 255+ · OpenSSH 8.7p1 (RHEL 9) / 9.6p1 (Ubuntu 24.04) · nftables 1.0.x · chrony 4.x · Pacemaker 2.1.x · Corosync 3.1.x · 2026-08-09
The OTel host receiver collects host metrics in OTLP format, replacing node_exporter. The process receiver adds per-process metrics. Together they cover the standard host-monitoring needs in OTel form.
Host receiver
The hostmetrics receiver collects:
- CPU usage (per core and aggregate).
- Memory (total, available, used, cached).
- Disk I/O (per device, per mount).
- Network I/O (per interface).
- Filesystem usage.
- Load average.
- Process count and state.
- Paging.
receivers:
hostmetrics:
collection_interval: 30s
scrapers:
cpu:
metrics:
system.cpu.utilization:
enabled: true
memory:
disk:
load:
processes:
paging:
filesystem:
include_mount_points:
mount_points: [/, /var]
match_type: strict
network:
include:
interfaces: [eth0]
match_type: strict
Three details in that config are easy to get wrong.
No type: field. In collector configuration the map key
is the component type. Writing type: hostmetrics inside the
hostmetrics: block adds an unknown key, and the collector
refuses to start with has invalid keys: type.
Each scraper appears exactly once. network: is listed once,
with its filter. Listing it twice is a hard failure - see below.
Filters are nested, not bare lists. The filesystem scraper
takes include_mount_points.mount_points plus a match_type;
the network scraper takes include.interfaces plus a
match_type. A bare mount_points: or interfaces: list at the
scraper level is not a valid key.
The receiver runs as part of the OTel agent (or gateway). Output is in OTLP format and can be exported to Prometheus or any OTel-compatible backend.
Process scraper
Per-process metrics are not a separate receiver. They come from
the process scraper inside the same hostmetrics receiver, so
they go in the same scrapers: map:
receivers:
hostmetrics:
collection_interval: 30s
scrapers:
cpu:
memory:
process:
metrics:
process.cpu.utilization:
enabled: true
process.memory.usage:
enabled: true
process.disk.io:
enabled: true
Note the difference between two similarly named scrapers.
processes: reports system-wide process counts by state.
process: reports metrics per individual process.
Per-process metrics are valuable for identifying which
process is the resource consumer. They replace ad-hoc tools
like pidstat for monitoring purposes.
Export to Prometheus
exporters:
prometheus:
endpoint: 0.0.0.0:8889
resource_to_telemetry_conversion:
enabled: true
service:
pipelines:
metrics:
receivers: [hostmetrics]
exporters: [prometheus]
The pipeline lists hostmetrics only. There is no process
receiver to list - the process scraper is already inside
hostmetrics. Naming a component in a pipeline that is not
defined in the corresponding section is another start-up
failure.
The OTel Collector exposes Prometheus metrics on port 8889. Prometheus scrapes this like any other target.
The resource_to_telemetry_conversion adds resource
attributes (host, service) as Prometheus labels.
Replace node_exporter
For a fleet already on OTel, the host receiver replaces node_exporter:
| Need | Tool |
|---|---|
| Host metrics via Prometheus | node_exporter |
| Host metrics via OTel | hostmetrics receiver |
| Per-process metrics via OTel | hostmetrics process scraper |
Migration:
- Validate the config on one host:
otelcol validate --config /etc/otelcol/config.yaml. - Deploy the OTel agent with the host receiver on that one host
and confirm the service is
active (running), not restarting. - Configure Prometheus to scrape the OTel endpoint.
- Update dashboards to use the OTel metric names.
- Run both node_exporter and the OTel agent in parallel until the new dashboards and alerts have fired at least once on real data.
- Only then remove node_exporter.
Metric name changes:
node_cpu_seconds_total→system.cpu.time(orsystem.cpu.utilization).node_memory_MemAvailable_bytes→system.memory.available.node_filesystem_size_bytes→system.filesystem.usage.
The semantic is the same; the name is OTel-idiomatic.
Knowledge check
Knowledge check · 5 questions
Q1. What does the OTel host receiver do?
Q2. The OTel host receiver is a direct replacement for node_exporter in OTel-based stacks.
Q3. Which of the following metrics does the hostmetrics receiver provide? Select all that apply.
Q4. You edit the collector config, your editor and a YAML linter both report it as valid, you merge, and the whole fleet of collectors fails to start. The config defines the network scraper twice. Why did the linter not catch it?
Q5. You have followed the migration steps and removed node_exporter. Two hours later a colleague asks why the host dashboards are flat. What is the most likely explanation, and why did nothing alert?
Passing score: 75%. Answers are checked in this browser.