Hosts
The Hosts tab of Infrastructure
lists your machines with their CPU, memory, disk and load. That data comes from the
OpenTelemetry Collector’s hostmetrics receiver, running on each machine, plus the
resourcedetection processor, which names the machine.
Use this page when the Hosts tab says No host metrics yet, an
instrumentation check
reports missing host metrics or host.name, or you add a new server or VM.
On Kubernetes you don’t need this page: the k8s-infra chart already runs the
receiver on every node. See
hostmetrics receiver.
What the Hosts tab needs
Section titled “What the Hosts tab needs”| Data | Produced by | Used for |
|---|---|---|
system.cpu.time |
hostmetrics cpu scraper |
CPU usage and Iowait columns |
system.memory.usage |
memory scraper |
Memory usage column |
system.cpu.load_average.15m |
load scraper |
Load avg (15min) column |
system.filesystem.usage |
filesystem scraper |
Disk usage column |
host.name resource attribute |
resourcedetection processor |
One row per host; without it the list is empty |
os.type resource attribute |
resourcedetection (system detector) |
OS Type filter |
These four metrics and host.name are what the instrumentation checks on the Hosts
tab look for.
The host’s details panel draws more charts from the same receiver:
| Charts | Metrics | Scraper |
|---|---|---|
| System load average | system.cpu.load_average.1m, .5m, .15m |
load |
| Disk IO, operations, operation time, queue size | system.disk.io, system.disk.operations, system.disk.operation_time, system.disk.pending_operations |
disk |
| Network usage, packets, errors, drops, connections | system.network.io, system.network.packets, system.network.errors, system.network.dropped, system.network.connections |
network |
Process metrics are optional. FuseScope’s processes check looks for
process.cpu.time and process.memory.usage with the process.pid resource
attribute, from the process scraper. The host panel has no processes view yet;
chart them in Metrics.
The config
Section titled “The config”Add this to the collector on the machine. It extends the base config from
Collector on a VM or
Collector on Docker: keep your
otlp receiver, exporter and other pipelines.
receivers: hostmetrics: collection_interval: 30s scrapers: cpu: {} memory: {} load: {} filesystem: {} disk: {} network: {}
processors: resourcedetection: detectors: [env, system] system: hostname_sources: [os] memory_limiter: check_interval: 1s limit_percentage: 80 spike_limit_percentage: 25 batch: {}
exporters: otlphttp: endpoint: http://fusescope-collector.example.com:4318
service: pipelines: metrics/host: receivers: [hostmetrics] processors: [memory_limiter, resourcedetection, batch] exporters: [otlphttp]hostname_sources: [os]setshost.nameto the machine’s hostname. The default,[dns, os], may use a fully qualified DNS name instead.envreadsOTEL_RESOURCE_ATTRIBUTESfrom the collector’s environment and runs first, so a value there wins, for exampleOTEL_RESOURCE_ATTRIBUTES=host.name=web-1,deployment.environment.name=production.- To also tag app traces and logs with
host.name, addresourcedetectionto those pipelines too. Traces in the host panel are matched byhost.name.
On a cloud VM
Section titled “On a cloud VM”Cloud detectors add the instance’s region, zone and ID, and on most clouds a
host.name of their own. Add the one for your cloud:
processors: resourcedetection: detectors: [env, ec2, system] # or gcp, azure system: hostname_sources: [os]When several detectors set the same attribute, the first one in the list wins. Put
system before the cloud detector if you want the OS hostname as host.name.
Optional metrics
Section titled “Optional metrics”system.cpu.utilization and system.memory.utilization (0 to 1) are off by default.
The Hosts tab doesn’t need them; turn them on if your own dashboards or alerts use
them:
receivers: hostmetrics: scrapers: cpu: metrics: system.cpu.utilization: enabled: true memory: metrics: system.memory.utilization: enabled: trueProcess metrics
Section titled “Process metrics”The process scraper sends one series per process, which adds many series on a busy
machine. Without root it can’t read other users’ processes, and logs an error for each
one. Mute those errors:
receivers: hostmetrics: scrapers: process: mute_process_name_error: true mute_process_exe_error: true mute_process_io_error: true mute_process_user_error: true mute_process_cgroup_error: truemute_process_all_errors: true mutes them all at once. Use include or exclude
with names to limit which processes are scraped.
Run it
Section titled “Run it”Install otelcol-contrib as in Collector on a VM,
add the config above to /etc/otelcol-contrib/config.yaml, then:
sudo systemctl restart otelcol-contribsudo journalctl -u otelcol-contrib -fThe receiver reads /proc and /sys directly; no root_path is needed.
A container sees its own file systems and network, not the host’s. Mount the host’s root file system read-only, tell the receiver where it is, and share the host network:
receivers: hostmetrics: root_path: /hostfs collection_interval: 30s scrapers: cpu: {} memory: {} load: {} filesystem: {} disk: {} network: {}docker run -d --name otel-collector \ --net host \ -v /:/hostfs:ro \ -v "$(pwd)/config.yaml:/etc/otelcol-contrib/config.yaml:ro" \ otel/opentelemetry-collector-contrib:0.139.0| Flag | Why |
|---|---|
-v /:/hostfs:ro + root_path: /hostfs |
The receiver reads the host’s /proc, /sys and mounts. |
--net host |
Without it, the network scraper reports the container’s interfaces. It also makes the container’s hostname the host’s, so host.name is right. Ports are then the host’s own: no -p flags. |
--pid host --user 0:0 |
Only for the process scraper: shows the host’s processes and lets the collector read them. |
Without --net host, set host.name yourself:
-e OTEL_RESOURCE_ATTRIBUTES=host.name=$(hostname).
Check that it works
Section titled “Check that it works”- Look for errors in the collector logs, such as
failed to readfrom a scraper. - Open Infrastructure › Hosts. The host appears with Active status within a few collection intervals. Click Recheck on the instrumentation checks.
- If the host is missing but metrics arrive, search for
system.cpu.timein Metrics and check that it hashost.name.