Skip to main content

Kubernetes Host Metrics

Overview

Kubernetes Host Metrics is a thin K8s-aware wrapper around the Host Metrics source. It collects node-level OS metrics (CPU, memory, disk, network, load, …) by reading the node's /proc and /sys filesystems rather than the container's. The receiver is intended to run as a DaemonSet so every node in the cluster is sampled.

The wrapper applies two K8s-specific defaults on top of Host Metrics:

  1. root_path: /hostfs — the receiver looks for /proc, /sys, etc. under /hostfs instead of /. The pipeline's deployment packaging mounts the node's root filesystem at /hostfs automatically (hostPath: //hostfs, read-only) so this just works.
  2. scrapers UI shape — accepts a flat array (["cpu", "memory", "load"]) and an optional_metrics array, and translates them into the nested {cpu: true, cpu_optional: {enable: true}} map the underlying Host Metrics receiver expects. This keeps the form schema simple while preserving access to the upstream optional-metric toggles.

For the full scraper / metric list, see Host Metrics.

Supported types: Metrics

Deployment mode: DaemonSet (one pod per node). The packaging layer forces Kind: DaemonSet regardless of any other setting, since per-node host sampling only makes sense as a DaemonSet.

Basic Configuration

ParameterTypeDefaultRequiredDescription
collection_intervalstring10sNoHow often the receiver samples the host.
scrapersstring[]YesList of scrapers to enable. Pick from: cpu, memory, disk, filesystem, load, network, paging, processes, process, system.
optional_metricsstring[][]NoSubset of scrapers to additionally enable each scraper's optional (off-by-default) metrics for. See the Host Metrics doc for the full list.
root_pathstring/hostfsNoOverride only when you mount the node root at a non-default path. The deployment packaging defaults this for you — leave unset in normal use.

K8s Deployment Options

The following fields control how the resulting OpenTelemetryCollector CR / DaemonSet pod is provisioned. They are read by extractDeployMeta and applied at packaging time, not passed to the underlying receiver.

ParameterTypeDefaultDescription
kindstringDaemonSetWorkload kind. Forced to DaemonSet for this source — overrides are ignored.
priorityClassboolfalseWhen true, applies priorityClassName to the pod.
priorityClassNamestringThe PriorityClass to assign (typically system-node-critical for node-agent workloads).
apply_tolerationsboolfalseWhen true, the pod tolerates all taints — required to schedule on tainted nodes (control-plane, GPU, etc.).

Example Configuration

{
"collection_interval": "30s",

"scrapers": ["cpu", "memory", "disk", "filesystem", "load", "network"],

// Enable optional metrics for cpu and memory only
"optional_metrics": ["cpu", "memory"],

// K8s deploy options
"priorityClass": true,
"priorityClassName": "system-node-critical",
"apply_tolerations": true,
}

Notes

  • Volume mount is automatic. When this source is used in a pipeline, the cloud-side packaging adds hostPath: / mounted read-only at /hostfs on the DaemonSet pod. You don't need to declare it.
  • process scraper requires elevated privileges. Listing other processes' details means the collector pod must run with sufficient host visibility — typically hostPID: true and securityContext.runAsUser: 0. The default unprivileged collector image will silently see only its own process.
  • DaemonSet merge. When a pipeline contains two or more of k8s_logs, k8s_kubeletstats, and k8s_hostmetrics, all of them are co-located in a single per-node DaemonSet (<pipeline>-node-agent) instead of separate ones. Default on — set ADL_K8S_MERGE_NODE_AGENT=false on the cloud side to opt out. See the pipeline architecture doc.