Host metrics

Collect metric data from the local system

status: stable role: daemon delivery: at-least-once acknowledgements: no 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"
    }
  }
}
[sources.my_source_id]
type = "host_metrics"
sources:
  my_source_id:
    type: host_metrics
{
  "sources": {
    "my_source_id": {
      "type": "host_metrics",
      "collectors": [
        "cgroups"
      ],
      "namespace": "host",
      "scrape_interval_secs": 15
    }
  }
}
[sources.my_source_id]
type = "host_metrics"
collectors = [ "cgroups" ]
namespace = "host"
scrape_interval_secs = 15
sources:
  my_source_id:
    type: host_metrics
    collectors:
      - cgroups
    namespace: host
    scrape_interval_secs: 15

cgroups

optional object

Options for the cgroups (controller groups) metrics collector.

This collector is only available on Linux systems, and only supports either version 2 or hybrid cgroups.

cgroups.base

optional string literal
The base cgroup name to provide metrics for.
Examples
"/"
"system.slice/snapd.service"

cgroups.groups

optional object
Lists of cgroup name patterns to include or exclude in gathering usage metrics.
cgroups.groups.excludes
optional [string]

Any patterns which should be excluded.

The patterns are matched using globbing.

cgroups.groups.includes
optional [string]

Any patterns which should be included.

The patterns are matched using globbing.

default: [*]
Examples
{
  "excludes": [
    "*.service"
  ],
  "includes": [
    "user.slice/*"
  ]
}

cgroups.levels

optional uint

The number of levels of the cgroups hierarchy for which to report metrics.

A value of 1 means the root or named cgroup.

Examples
1
3
default: 100

collectors

optional [string]

The list of host metric collector services to use.

Defaults to all collectors.

Array string literal
Examples
[
  "cgroups",
  "cpu",
  "disk",
  "filesystem",
  "load",
  "host",
  "memory",
  "network"
]
default: [cpu disk filesystem load host memory network process cgroups]

disk

optional object
Options for the disk metrics collector.

disk.devices

optional object
Lists of device name patterns to include or exclude in gathering I/O utilization metrics.
disk.devices.excludes
optional [string]

Any patterns which should be excluded.

The patterns are matched using globbing.

disk.devices.includes
optional [string]

Any patterns which should be included.

The patterns are matched using globbing.

default: [*]
Examples
{
  "excludes": [
    "dm-*"
  ],
  "includes": [
    "sda"
  ]
}

filesystem

optional object
Options for the filesystem metrics collector.

filesystem.devices

optional object
Lists of device name patterns to include or exclude in gathering usage metrics.

Any patterns which should be excluded.

The patterns are matched using globbing.

Any patterns which should be included.

The patterns are matched using globbing.

default: [*]
Examples
{
  "excludes": [
    "dm-*"
  ],
  "includes": [
    "sda"
  ]
}

filesystem.filesystems

optional object
Lists of filesystem name patterns to include or exclude in gathering usage metrics.

Any patterns which should be excluded.

The patterns are matched using globbing.

Any patterns which should be included.

The patterns are matched using globbing.

default: [*]
Examples
{
  "excludes": [
    "ext*"
  ],
  "includes": [
    "ntfs"
  ]
}

filesystem.mountpoints

optional object
Lists of mount point path patterns to include or exclude in gathering usage metrics.

Any patterns which should be excluded.

The patterns are matched using globbing.

Any patterns which should be included.

The patterns are matched using globbing.

default: [*]
Examples
{
  "excludes": [
    "/raid*"
  ],
  "includes": [
    "/home"
  ]
}

namespace

optional string literal
Overrides the default namespace for the metrics emitted by the source.
default: host

network

optional object
Options for the network metrics collector.

network.devices

optional object
Lists of device name patterns to include or exclude in gathering network utilization metrics.
network.devices.excludes
optional [string]

Any patterns which should be excluded.

The patterns are matched using globbing.

network.devices.includes
optional [string]

Any patterns which should be included.

The patterns are matched using globbing.

default: [*]
Examples
{
  "excludes": [
    "dm-*"
  ],
  "includes": [
    "sda"
  ]
}

process

optional object
Options for the process metrics collector.

process.processes

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

Any patterns which should be excluded.

The patterns are matched using globbing.

Any patterns which should be included.

The patterns are matched using globbing.

default: [*]
Examples
{
  "excludes": null,
  "includes": [
    "docker"
  ]
}

scrape_interval_secs

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

Outputs

<component_id>

Default output stream of the component. Use this component’s ID as an input to downstream transforms and sinks.

Output Data

Metrics

boot_time

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

cgroup_cpu_system_seconds_total

counter
The total amount of CPU time spent by this cgroup in system tasks, in seconds.
cgroup
The control group name.
collector
Which collector this metric comes from.
host
The hostname of the originating system.

cgroup_cpu_usage_seconds_total

counter
The total amount CPU time used by this cgroup and its descendants, in seconds.
cgroup
The control group name.
collector
Which collector this metric comes from.
host
The hostname of the originating system.

cgroup_cpu_user_seconds_total

counter
The total amount of CPU time spent by this cgroup in user space, in seconds.
cgroup
The control group name.
collector
Which collector this metric comes from.
host
The hostname of the originating system.

cgroup_memory_anon_bytes

gauge
The total amount of memory used by this cgroup in anonymous mappings (normal program allocation), in bytes.
cgroup
The control group name.
collector
Which collector this metric comes from.
host
The hostname of the originating system.

cgroup_memory_current_bytes

gauge
The total amount of memory currently being used by this cgroup and its descendants, in bytes.
cgroup
The control group name.
collector
Which collector this metric comes from.
host
The hostname of the originating system.

cgroup_memory_file_bytes

gauge
The total amount of memory used by this cgroup to cache filesystem data, including tmpfs and shared memory, in bytes.
cgroup
The control group name.
collector
Which collector this metric comes from.
host
The hostname of the originating system.

disk_read_bytes_total

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

disk_reads_completed_total

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

disk_writes_completed_total

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

disk_written_bytes_total

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

filesystem_free_bytes

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

filesystem_total_bytes

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

filesystem_used_bytes

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

filesystem_used_ratio

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

host_cpu_seconds_total

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

host_logical_cpus

gauge
The number of logical CPUs.

host_physical_cpus

gauge
The number of physical CPUs.

load1

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

load15

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

load5

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

memory_active_bytes

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

memory_available_bytes

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

memory_buffers_bytes

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

memory_cached_bytes

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

memory_free_bytes

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

memory_inactive_bytes

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

memory_shared_bytes

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

memory_swap_free_bytes

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

memory_swap_total_bytes

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

memory_swap_used_bytes

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

memory_swapped_in_bytes_total

counter
The number of bytes that have been swapped into main memory.
collector
Which collector this metric comes from.
host
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
Which collector this metric comes from.
host
The hostname of the originating system.

memory_total_bytes

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

memory_used_bytes

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

memory_wired_bytes

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

network_receive_bytes_total

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

network_receive_errs_total

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

network_receive_packets_total

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

network_transmit_bytes_total

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

network_transmit_errs_total

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

network_transmit_packets_drop_total

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

network_transmit_packets_total

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

process_cpu_usage

gauge
The process CPU usage.
collector
Which collector this metric comes from.
host
The hostname of the originating system.

process_memory_usage

gauge
The process memory usage.
collector
Which collector this metric comes from.
host
The hostname of the originating system.

process_runtime

counter
The process uptime.
collector
Which collector this metric comes from.
host
The hostname of the originating system.

uptime

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

Telemetry

Metrics

link

component_discarded_events_total

counter
The number of events dropped by this component.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
host optional
The hostname of the system Vector is running on.
intentional
True if the events were discarded intentionally, like a filter transform, or false if due to an error.
pid optional
The process ID of the Vector instance.

component_errors_total

counter
The total number of errors encountered by this component.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
error_type
The type of the error
host optional
The hostname of the system Vector is running on.
pid optional
The process ID of the Vector instance.
stage
The stage within the component at which the error occurred.

component_received_bytes_total

counter
The number of raw bytes accepted by this component from source origins.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
container_name optional
The name of the container from which the data originated.
file optional
The file from which the data originated.
host optional
The hostname of the system Vector is running on.
mode optional
The connection mode used by the component.
peer_addr optional
The IP from which the data originated.
peer_path optional
The pathname from which the data originated.
pid optional
The process ID of the Vector instance.
pod_name optional
The name of the pod from which the data originated.
uri optional
The sanitized URI from which the data originated.

component_received_event_bytes_total

counter
The number of event bytes accepted by this component either from tagged origins like file and uri, or cumulatively from other origins.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
container_name optional
The name of the container from which the data originated.
file optional
The file from which the data originated.
host optional
The hostname of the system Vector is running on.
mode optional
The connection mode used by the component.
peer_addr optional
The IP from which the data originated.
peer_path optional
The pathname from which the data originated.
pid optional
The process ID of the Vector instance.
pod_name optional
The name of the pod from which the data originated.
uri optional
The sanitized URI from which the data originated.

component_received_events_count

histogram

A histogram of the number of events passed in each internal batch in Vector’s internal topology.

Note that this is separate than sink-level batching. It is mostly useful for low level debugging performance issues in Vector due to small internal batches.

component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
container_name optional
The name of the container from which the data originated.
file optional
The file from which the data originated.
host optional
The hostname of the system Vector is running on.
mode optional
The connection mode used by the component.
peer_addr optional
The IP from which the data originated.
peer_path optional
The pathname from which the data originated.
pid optional
The process ID of the Vector instance.
pod_name optional
The name of the pod from which the data originated.
uri optional
The sanitized URI from which the data originated.

component_received_events_total

counter
The number of events accepted by this component either from tagged origins like file and uri, or cumulatively from other origins.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
container_name optional
The name of the container from which the data originated.
file optional
The file from which the data originated.
host optional
The hostname of the system Vector is running on.
mode optional
The connection mode used by the component.
peer_addr optional
The IP from which the data originated.
peer_path optional
The pathname from which the data originated.
pid optional
The process ID of the Vector instance.
pod_name optional
The name of the pod from which the data originated.
uri optional
The sanitized URI from which the data originated.

component_sent_event_bytes_total

counter
The total number of event bytes emitted by this component.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
host optional
The hostname of the system Vector is running on.
output optional
The specific output of the component.
pid optional
The process ID of the Vector instance.

component_sent_events_total

counter
The total number of events emitted by this component.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
host optional
The hostname of the system Vector is running on.
output optional
The specific output of the component.
pid optional
The process ID of the Vector instance.

source_lag_time_seconds

histogram
The difference between the timestamp recorded in each event and the time when it was ingested, expressed as fractional seconds.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
host optional
The hostname of the system Vector is running on.
pid optional
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.