Configure the OpenTelemetry Collector hostmetrics receiver to collect CPU, memory, disk, filesystem, and network metrics from the host
domain: github.com/open-telemetry/opentelemetry-collector-contrib · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Add a hostmetrics receiver block under receivers with collection_interval (default 1m) and initial_delay (default 1s), e.g. hostmetrics: { collection_interval: 30s }.
Under scrapers, enable the desired categories by adding their keys (empty or with options): cpu, memory, disk, filesystem, network — plus load, paging, processes, process, system, or nfs where OS-supported.
For filesystem, use include_devices/exclude_devices, include_fs_types/exclude_fs_types, and include_mount_points/exclude_mount_points blocks (each with match_type: strict or regexp) to scope which filesystems are scraped, and set include_virtual_filesystems: true if needed.
For disk and network, use include/exclude blocks with devices or interfaces plus match_type to filter which devices/NICs are scraped.
Add the receiver to a metrics pipeline under service.pipelines.metrics.receivers.
When running inside a container, bind-mount the host filesystem (e.g. docker run -v /:/hostfs) and set root_path: /hostfs so the scrapers read host paths instead of the container's own; all hostmetrics instances on the same Collector must use the same root_path.
Known gotchas
Overall metrics support is beta while the newer host entity-event-as-logs feature is development/experimental (default every 5 minutes via metadata_collection_interval); check each individual scraper's documentation.md for per-metric OS compatibility since it varies by scraper.
The receiver does not set any resource attributes itself (e.g. host.name) — pair it with the resourcedetection processor or OTEL_RESOURCE_ATTRIBUTES if you need host identity on the emitted metrics.
On Collectors not linked to glibc (CGO_ENABLED=0), the process scraper can fail to resolve usernames/owners for processes whose accounts are resolved via NSS (e.g. systemd DynamicUser), leaving process.owner unset.
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?