Hostmetrics Receiver
core, contrib, k8s
Maintainers: @dmitryax, @braydonk, @rogercoll
Source: opentelemetry-collector-contrib
Supported Telemetry
Overview
Getting Started
The collection interval, root path, the categories of metrics, and individual metrics to be scraped can be configured:| Scraper | Supported OSs | Description |
|---|---|---|
| cpu | All | CPU utilization metrics |
| disk | All | Disk I/O metrics |
| load | All | CPU load metrics |
| filesystem | All | File System utilization metrics |
| memory | All | Memory utilization metrics |
| network | All | Network interface I/O metrics & TCP connection metrics |
| nfs | Linux | NFS server and client metrics |
| paging | All | Paging/Swap space utilization and I/O metrics |
| processes | Linux, Mac, FreeBSD, OpenBSD | Process count metrics |
| process | Linux, Windows, Mac, FreeBSD | Per process CPU, Memory, and Disk I/O metrics |
| system | Linux, Windows, Mac | Miscellaneous system metrics |
Notes
Several scrapers support additional configuration:Disk
File System
Load
cpu_average specifies whether to divide the average load by the reported number of logical CPUs (default: false).
Network
Process
mute_process_all_errors(default: false): mute all the errors encountered when trying to read metrics of a process. When this flag is enabled, there is no need to activate any other error suppression flags.mute_process_name_error(default: false): mute the error encountered when trying to read a process name the collector does not have permission to read. This flag is ignored whenmute_process_all_errorsis set to true as all errors are muted.mute_process_io_error(default: false): mute the error encountered when trying to read IO metrics of a process the collector does not have permission to read. This flag is ignored whenmute_process_all_errorsis set to true as all errors are muted.mute_process_cgroup_error(default: false): mute the error encountered when trying to read the cgroup of a process the collector does not have permission to read. This flag is ignored whenmute_process_all_errorsis set to true as all errors are muted.mute_process_exe_error(default: false): mute the error encountered when trying to read the executable path of a process the collector does not have permission to read (Linux only). This flag is ignored whenmute_process_all_errorsis set to true as all errors are muted.mute_process_user_error(default: false): mute the error encountered when trying to read a uid which doesn’t exist on the system, eg. is owned by a user that only exists in a container. This flag is ignored whenmute_process_all_errorsis set to true as all errors are muted.
Advanced Configuration
Filtering
If you are only interested in a subset of metrics from a particular source, it is recommended you use this receiver with the Filter Processor.Different Frequencies
If you would like to scrape some metrics at a different frequency than others, you can configure multiplehostmetrics receivers with different
collection_interval values. For example:
Collecting host metrics from inside a container (Linux only)
Host metrics are collected from the Linux system directories on the filesystem. You likely want to collect metrics about the host system and not the container. This is achievable by following these steps:1. Bind mount the host filesystem
The simplest configuration is to mount the entire host filesystem when running the container. e.g.docker run -v /:/hostfs ....
You can also choose which parts of the host filesystem to mount, if you know
exactly what you’ll need. e.g. docker run -v /proc:/hostfs/proc.
2. Configure root_path
Configure root_path so the hostmetrics receiver knows where the root filesystem is.
Note: if running multiple instances of the host metrics receiver, they must all have
the same root_path.
Example:
Resource attributes
Currently, the hostmetrics receiver does not set any Resource attributes on the exported metrics. However, if you want to set Resource attributes, you can provide them via environment variables via the resourcedetection processor. For example, you can add the following resource attributes to adhere to Resource Semantic Conventions:Entity Events
Entity Events as logs are experimental and might eventually be replaced by the result of the OTEP. For now, the hostmetrics receiver can send the host entity event as a log records. By default, the hostmetrics receiver sends periodic EntityState events every 5 minutes. You can change that by settingmetadata_collection_interval. Entity Events as logs are experimental. The result of the OTEP might eventually replace that.
Configuration
Example Configuration
Last generated: 2026-04-13