Host metrics

Collect metric data from the local system

status: beta role: daemon delivery: at-least-once egress: batch state: stateless output: metrics
Examines system data sources on the local system and generates metrics describing utilization of various system resources, such as CPU, memory, disk, and network utilization.

Warnings

When vector is run under kubernetes, you may experience an error when loading the partition usage data: Failed to load partition usage data. mount_point="/host/proc/sys/fs/binfmt_misc" error=FFI function "statvfs" call failed: Too many levels of symbolic links (os error 40) To work around this configuration issue, add one of the following lines to the host_metrics configuration section: filesystem.devices.excludes = ["binfmt_misc"], filesystem.filesystems.excludes = ["binfmt_misc"], or filesystem.mountpoints.excludes = ["*/proc/sys/fs/binfmt_misc"]. This workaround is included by default in the Helm chart distributed with Vector.

Configuration

Example configurations

{
  "sources": {
    "my_source_id": {
      "type": "host_metrics",
      "collectors": [
        "cpu"
      ],
      "scrape_interval_secs": 15
    }
  }
}
[sources.my_source_id]
type = "host_metrics"
collectors = [ "cpu" ]
scrape_interval_secs = 15
---
sources:
  my_source_id:
    type: host_metrics
    collectors:
      - cpu
    scrape_interval_secs: 15
{
  "sources": {
    "my_source_id": {
      "type": "host_metrics",
      "collectors": [
        "cpu"
      ],
      "namespace": "host",
      "scrape_interval_secs": 15
    }
  }
}
[sources.my_source_id]
type = "host_metrics"
collectors = [ "cpu" ]
namespace = "host"
scrape_interval_secs = 15
---
sources:
  my_source_id:
    type: host_metrics
    collectors:
      - cpu
    namespace: host
    scrape_interval_secs: 15
    disk: null
    filesystem: null
    network: null

collectors

common optional [string]
The list of host metric collector services to use. Defaults to all collectors.
Array string literal
Examples
[
  "cpu",
  "disk",
  "filesystem",
  "load",
  "host",
  "memory",
  "network"
]
default: [cpu disk filesystem load host memory network]

disk

optional object
Options for the “disk” metrics collector.

disk.devices

optional object
Lists of device name patterns to include or exclude.

filesystem

optional object
Options for the “filesystem” metrics collector.

filesystem.devices

optional object
Lists of device name patterns to include or exclude.

filesystem.filesystems

optional object
Lists of filesystem name patterns to include or exclude.

filesystem.mountpoints

optional object
Lists of mount point path patterns to include or exclude.

namespace

optional string literal
The namespace of metrics. Disabled if empty.
default: host

network

optional object
Options for the “network” metrics collector.

network.devices

optional object
Lists of device name patterns to include or exclude.

scrape_interval_secs

common optional uint
The interval between metric gathering, in seconds.
default: 15 (seconds)

Environment variables

PROCFS_ROOT

common optional string literal
Sets an arbitrary path to the system’s Procfs root. Can be used to expose host metrics from within a container. Unset and uses system /proc by default.
Examples
/mnt/host/proc

SYSFS_ROOT

common optional string literal
Sets an arbitrary path to the system’s Sysfs root. Can be used to expose host metrics from within a container. Unset and uses system /sys by default.
Examples
/mnt/host/sys

Output

Metrics

boot_time

gauge
The UNIX timestamp of the last boot.
collector required
Which collector this metric comes from.
host required
The hostname of the originating system.

disk_read_bytes_total

counter
The accumulated number of bytes read in.
collector required
Which collector this metric comes from.
device required
The disk device name.
host required
The hostname of the originating system.

disk_reads_completed_total

counter
The accumulated number of read operations completed.
collector required
Which collector this metric comes from.
device required
The disk device name.
host required
The hostname of the originating system.

disk_writes_completed_total

counter
The accumulated number of write operations completed.
collector required
Which collector this metric comes from.
device required
The disk device name.
host required
The hostname of the originating system.

disk_written_bytes_total

counter
The accumulated number of bytes written out.
collector required
Which collector this metric comes from.
device required
The disk device name.
host required
The hostname of the originating system.

filesystem_free_bytes

gauge
The number of bytes free on the named filesystem.
collector required
Which collector this metric comes from.
device required
The disk device name.
filesystem required
The name of the filesystem type.
host required
The hostname of the originating system.

filesystem_total_bytes

gauge
The total number of bytes in the named filesystem.
collector required
Which collector this metric comes from.
device required
The disk device name.
filesystem required
The name of the filesystem type.
host required
The hostname of the originating system.

filesystem_used_bytes

gauge
The number of bytes used on the named filesystem.
collector required
Which collector this metric comes from.
device required
The disk device name.
filesystem required
The name of the filesystem type.
host required
The hostname of the originating system.

filesystem_used_ratio

gauge
The ratio between used and total bytes on the named filesystem.
collector required
Which collector this metric comes from.
device required
The disk device name.
filesystem required
The name of the filesystem type.
host required
The hostname of the originating system.

host_cpu_seconds_total

counter
The number of CPU seconds accumulated in different operating modes.
collector required
Which collector this metric comes from.
cpu required
The index of the CPU core or socket.
host required
The hostname of the originating system.
mode required
Which mode the CPU was running in during the given time.

load1

gauge
System load averaged over the last 1 second.
collector required
Which collector this metric comes from.
host required
The hostname of the originating system.

load15

gauge
System load averaged over the last 15 seconds.
collector required
Which collector this metric comes from.
host required
The hostname of the originating system.

load5

gauge
System load averaged over the last 5 seconds.
collector required
Which collector this metric comes from.
host required
The hostname of the originating system.

memory_active_bytes

gauge
The number of bytes of active main memory.
collector required
Which collector this metric comes from.
host required
The hostname of the originating system.

memory_available_bytes

gauge
The number of bytes of main memory available.
collector required
Which collector this metric comes from.
host required
The hostname of the originating system.

memory_buffers_bytes

gauge
The number of bytes of main memory used by buffers.
collector required
Which collector this metric comes from.
host required
The hostname of the originating system.

memory_cached_bytes

gauge
The number of bytes of main memory used by cached blocks.
collector required
Which collector this metric comes from.
host required
The hostname of the originating system.

memory_free_bytes

gauge
The number of bytes of main memory not used.
collector required
Which collector this metric comes from.
host required
The hostname of the originating system.

memory_inactive_bytes

gauge
The number of bytes of main memory that is not active.
collector required
Which collector this metric comes from.
host required
The hostname of the originating system.

memory_shared_bytes

gauge
The number of bytes of main memory shared between processes.
collector required
Which collector this metric comes from.
host required
The hostname of the originating system.

memory_swap_free_bytes

gauge
The number of free bytes of swap space.
collector required
Which collector this metric comes from.
host required
The hostname of the originating system.

memory_swap_total_bytes

gauge
The total number of bytes of swap space.
collector required
Which collector this metric comes from.
host required
The hostname of the originating system.

memory_swap_used_bytes

gauge
The number of used bytes of swap space.
collector required
Which collector this metric comes from.
host required
The hostname of the originating system.

memory_swapped_in_bytes_total

counter
The number of bytes that have been swapped in to main memory.
collector required
Which collector this metric comes from.
host required
The hostname of the originating system.

memory_swapped_out_bytes_total

counter
The number of bytes that have been swapped out from main memory.
collector required
Which collector this metric comes from.
host required
The hostname of the originating system.

memory_total_bytes

gauge
The total number of bytes of main memory.
collector required
Which collector this metric comes from.
host required
The hostname of the originating system.

memory_used_bytes

gauge
The number of bytes of main memory used by programs or caches.
collector required
Which collector this metric comes from.
host required
The hostname of the originating system.

memory_wired_bytes

gauge
The number of wired bytes of main memory.
collector required
Which collector this metric comes from.
host required
The hostname of the originating system.

network_receive_bytes_total

gauge
The number of bytes received on this interface.
collector required
Which collector this metric comes from.
device required
The network interface device name.
host required
The hostname of the originating system.

network_receive_errs_total

gauge
The number of errors encountered during receives on this interface.
collector required
Which collector this metric comes from.
device required
The network interface device name.
host required
The hostname of the originating system.

network_receive_packets_total

gauge
The number of packets received on this interface.
collector required
Which collector this metric comes from.
device required
The network interface device name.
host required
The hostname of the originating system.

network_transmit_bytes_total

gauge
The number of bytes transmitted on this interface.
collector required
Which collector this metric comes from.
device required
The network interface device name.
host required
The hostname of the originating system.

network_transmit_errs_total

gauge
The number of errors encountered during transmits on this interface.
collector required
Which collector this metric comes from.
device required
The network interface device name.
host required
The hostname of the originating system.

network_transmit_packets_drop_total

gauge
The number of packets dropped during transmits on this interface.
collector required
Which collector this metric comes from.
device required
The network interface device name.
host required
The hostname of the originating system.

network_transmit_packets_total

gauge
The number of packets transmitted on this interface.
collector required
Which collector this metric comes from.
device required
The network interface device name.
host required
The hostname of the originating system.

uptime

gauge
The number of seconds since the last boot.
collector required
Which collector this metric comes from.
host required
The hostname of the originating system.

Telemetry

Metrics

link

events_out_total

counter
The total number of events emitted by this component.
component_id required
The Vector component ID.
component_kind required
The Vector component kind.
component_name required
Deprecated, use component_id instead. The value is the same as component_id.
component_type required
The Vector component type.
host required
The hostname of the system Vector is running on.
pid required
The process ID of the Vector instance.

processed_events_total

counter
The total number of events processed by this component. This metric is deprecated in place of using events_in_total and events_out_total metrics.
component_id required
The Vector component ID.
component_kind required
The Vector component kind.
component_name required
Deprecated, use component_id instead. The value is the same as component_id.
component_type required
The Vector component type.
host required
The hostname of the system Vector is running on.
pid required
The process ID of the Vector instance.

utilization

gauge
A ratio from 0 to 1 of the load on a component. A value of 0 would indicate a completely idle component that is simply waiting for input. A value of 1 would indicate a that is never idle. This value is updated every 5 seconds.
component_id required
The Vector component ID.
component_kind required
The Vector component kind.
component_name required
Deprecated, use component_id instead. The value is the same as component_id.
component_type required
The Vector component type.
host required
The hostname of the system Vector is running on.
pid required
The process ID of the Vector instance.

How it works

Context

By default, the host_metrics source augments events with helpful context keys.

State

This component is stateless, meaning its behavior is consistent across each input.