Host metrics receiver π
The host metrics receiver generates metrics scraped from host systems when the Collector is deployed as an agent. The supported pipeline type is metrics
.
By default, the host metrics receiver is activated in the Splunk Distribution of OpenTelemetry Collector and collects the following metrics:
CPU usage metrics
Disk I/O metrics
CPU load metrics
File system usage metrics
Memory usage metrics
Network interface and TCP connection metrics
Process count metrics (Linux only)
Per process CPU, memory, and disk I/O metrics
Host receiver metrics appear in Infrastructure Monitoring. You can use them to create dashboards and alerts. See Create detectors to trigger alerts for more information.
Note
The SignalFx exporter excludes some available metrics by default. Learn more about default metric filters in List of metrics excluded by default. The most up-to-date list of excluded metrics is in GitHub. See https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/signalfxexporter/internal/translation/default_metrics.go#L49.
Get started π
Follow these steps to configure and activate the component:
Deploy the Splunk Distribution of OpenTelemetry Collector to your host or container platform:
Configure the receiver as described in the next section.
Restart the Collector.
Note
Metrics produced by this receiver count towards the custom metric ingestion limit. See System limits for Splunk Infrastructure Monitoring.
Collect container host metrics (Linux) π
The host metrics receiver collects metrics from the Linux system directories. To collect metrics for the host instead of the container, follow these steps:
Mount the entire host file system when running the container. For example:
docker run -v /:/hostfs
. You can also choose which parts of the host file system to mount. For example:docker run -v /proc:/hostfs/proc
Configure
root_path
so that the host metrics receiver knows where the root file system is located. For example:receivers: hostmetrics: root_path: /hostfs
If you are running multiple instances of the host metrics receiver, set the same
root_path
for all.
Sample configurations π
The collection interval and the categories of metrics to be scraped can be configured as shown in the following example:
hostmetrics:
collection_interval: <duration> # The default is 1m.
scrapers:
<scraper1>:
<scraper2>:
...
Scrapers extract data from endpoints and then send that data to a specified target. The following table shows the available scrapers:
Scraper |
Description |
---|---|
|
CPU utilization metrics |
|
Disk I/O metrics |
|
CPU load metrics |
|
File system utilization metrics |
|
Memory utilization metrics |
|
Network interface I/O metrics and TCP connection metrics |
|
Paging or swap space utilization and I/O metrics |
|
Process count metrics. Only available on Linux |
|
Per process CPU, memory, and disk I/O metrics |
See the following sections for scraper configurations.
Disk π
disk:
<include|exclude>:
devices: [ <device name>, ... ]
match_type: <strict|regexp>
File system π
filesystem:
<include_devices|exclude_devices>:
devices: [ <device name>, ... ]
match_type: <strict|regexp>
<include_fs_types|exclude_fs_types>:
fs_types: [ <filesystem type>, ... ]
match_type: <strict|regexp>
<include_mount_points|exclude_mount_points>:
mount_points: [ <mount point>, ... ]
match_type: <strict|regexp>
The following example shows the forward slash (/
) as a common mount point for Linux systems:
filesystem:
include_mount_points:
mount_points: ["/"]
match_type: strict
Similarly, the following example shows C:
as a common mount point for Windows systems:
filesystem:
include_mount_points:
mount_points: ["C:"]
match_type: strict
To include virtual file systems, set include_virtual_filesystems
to true
.
filesystem:
include_virtual_filesystems: true
Find more examples in the daemonset.yaml file in GitHub.
Network π
network:
<include|exclude>:
interfaces: [ <interface name>, ... ]
match_type: <strict|regexp>
Process π
process:
<include|exclude>:
names: [ <process name>, ... ]
match_type: <strict|regexp>
mute_process_name_error: <true|false>
mute_process_exe_error: <true|false>
mute_process_io_error: <true|false>
scrape_process_delay: <time>
If you keep getting errors related to process reading, consider setting mute_process_name_error
, mute_process_exe_error
, or mute_process_io_error
to true
.
Filtering π
To only gather a subset of metrics from a particular source, use the
host metrics receiver with the filter
processor.
Different frequencies π
To scrape some metrics at a different frequency than others, configure
multiple host metrics receivers with different collection_interval
values. For example:
receivers:
hostmetrics:
collection_interval: 30s
scrapers:
cpu:
memory:
hostmetrics/disk:
collection_interval: 1m
scrapers:
disk:
filesystem:
service:
pipelines:
metrics:
receivers: [hostmetrics, hostmetrics/disk]
Metrics π
The following metrics, resource attributes, and attributes are available.
Note
The SignalFx exporter excludes some available metrics by default. Learn more about default metric filters in List of metrics excluded by default.
cpu scraper π
disk scraper π
filesystem scraper π
load scraper π
memory scraper π
network scraper π
paging scraper π
processes scraper π
process scraper π
Resource attributes π
The host metrics receiver doesnβt set any resource attributes on the exported metrics.
To set resource attributes, provide them using the OTEL_RESOURCE_ATTRIBUTES
environment variables. For example:
export OTEL_RESOURCE_ATTRIBUTES="service.name=<name_of_service>,service.version=<version_of_service>"
Activate or deactivate specific metrics π
You can activate or deactivate specific metrics by setting the enabled
field in the metrics
section for each metric. For example:
receivers:
samplereceiver:
metrics:
metric-one:
enabled: true
metric-two:
enabled: false
The following is an example of host metrics receiver configuration with activated metrics:
receivers:
hostmetrics:
scrapers:
process:
metrics:
process.cpu.utilization:
enabled: true
Note
Deactivated metrics arenβt sent to Splunk Observability Cloud.
Settings π
The following table shows the configuration options for the host metrics receiver:
Troubleshooting π
If you are a Splunk Observability Cloud customer and are not able to see your data in Splunk Observability Cloud, you can get help in the following ways.
Available to Splunk Observability Cloud customers π
Submit a case in the Splunk Support Portal.
Call Splunk Customer Support.
Available to customers and free trial users π
Ask a question and get answers through community support at Splunk Answers.
Join the Splunk #observability user group Slack channel to communicate with customers, partners, and Splunk employees worldwide. To join, see Chat groups in the Get Started with Splunk Community manual.
To learn about even more support options, see Splunk Customer Success.