---
title: Host Metrics
slug: telemetry-pipeline/host-metrics
docTags: 
createdAt: 2025-04-21T00:46:12.231Z
---

## Host Metrics Source

Collect metric data directly from the local system.

The Host Metrics source allows worker to run as a lightweight system agent, periodically collecting resource utilization metrics from the host operating system. It is designed for node-level observability and infrastructure monitoring.

This source is optimized for continuous, low-overhead metric collection on individual hosts.

## Collection Model

Worker inspects native operating system interfaces to gather metrics describing system resource usage, including:

- CPU utilization&#x20;
- Memory consumption&#x20;
- Disk I/O and usage&#x20;
- Filesystem capacity&#x20;
- Network throughput&#x20;
- Load averages&#x20;
- Process-level metrics&#x20;
- cgroups (Linux only)&#x20;
- TCP connection statistics&#x20;

Metrics are emitted at a configurable scrape interval and forwarded in batches to downstream sinks.

## Operating Environment

### Host-Based Execution

- Designed to run directly on virtual machines, bare-metal servers, or nodes&#x20;
- Commonly deployed as:&#x20;
  - A system service&#x20;
  - A container with host access&#x20;
  - A DaemonSet in Kubernetes environments&#x20;

### Stateless Behavior

- No local state is persisted&#x20;
- Each scrape cycle is independent&#x20;
- Suitable for ephemeral and autoscaled environments&#x20;

## Linux cgroups Support

On Linux systems, Host Metrics can collect resource usage from control groups (cgroups):

- Supports **cgroups v2** and **hybrid** configurations&#x20;
- Enables visibility into:&#x20;
  - Container-level CPU usage&#x20;
  - Memory limits and consumption&#x20;
  - Resource isolation behavior&#x20;

This is particularly valuable in containerized and multi-tenant environments.

## Kubernetes Considerations

When running under Kubernetes, certain virtual filesystems may cause filesystem metric collection errors due to symbolic link recursion.

Typical symptoms include failures when inspecting paths under /proc.

To mitigate this:

- Specific devices, filesystems, or mount points can be excluded from collection&#x20;
- This exclusion is enabled by default in the official Worker Helm chart&#x20;

These safeguards prevent unnecessary errors while maintaining accurate host-level metrics.

## Metric Namespacing

- All emitted metrics share a configurable namespace&#x20;
- Defaults to a host prefix&#x20;
- Helps distinguish host-level metrics from:&#x20;
  - Application metrics&#x20;
  - Container metrics&#x20;
  - Platform-specific telemetry&#x20;

## Collector Architecture

Host Metrics is composed of independent collectors, each responsible for a specific subsystem:

- CPU&#x20;
- Memory&#x20;
- Disk&#x20;
- Filesystem&#x20;
- Network&#x20;
- Load&#x20;
- Processes&#x20;
- cgroups&#x20;
- TCP&#x20;

Collectors can be selectively enabled or disabled to:

- Reduce overhead&#x20;
- Limit metric cardinality&#x20;
- Focus on relevant subsystems&#x20;

## Filtering and Scope Control

Fine-grained filtering is supported across multiple dimensions:

- Disk devices&#x20;
- Network interfaces&#x20;
- Filesystems&#x20;
- Mount points&#x20;
- Process names&#x20;
- cgroup hierarchies&#x20;

Pattern-based inclusion and exclusion allow precise control in complex environments with high resource churn.

## Reliability Characteristics

- Periodic, interval-based scraping&#x20;
- Batch-oriented metric delivery&#x20;
- At-least-once semantics&#x20;
- No acknowledgement tracking&#x20;
- Minimal runtime overhead&#x20;

This design makes Host Metrics suitable for continuous infrastructure monitoring without impacting application performance.

## Common Use Cases

- Node-level infrastructure monitoring&#x20;
- Capacity and utilization tracking&#x20;
- Kubernetes node observability&#x20;
- VM and bare-metal monitoring&#x20;
- Baseline metrics for alerting systems&#x20;
- Feeding metrics into:&#x20;
  - Prometheus-compatible backends&#x20;
  - Time-series databases&#x20;
  - Centralized observability platforms
