Host Metrics Source
The Vector host_metrics
source
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.
Configuration
- Common
- Advanced
- vector.toml
- vector.yaml
- vector.json
[sources.my_source_id]type = "host_metrics" # requiredcollectors = ["cpu", "disk", "filesystem", "load", "host", "memory", "network"] # optional, defaultscrape_interval_secs = 15 # optional, default, seconds
- commonoptional[string]
collectors
The list of host metric collector services to use. Defaults to all collectors.
- Default:
["cpu","disk","filesystem","load","host","memory","network"]
- View examples
- Default:
- optionaltable
disk
Options for the "disk" metrics collector.
- optionaltable
devices
Lists of device name patterns to include or exclude.
- optional[string]
excludes
The list of device name patterns for which to gather I/O utilization metrics. Defaults to excluding no devices. The patterns are matched using globbing.
- Default:
[]
- View examples
- Default:
- optional[string]
includes
The list of device name patterns for which to gather I/O utilization metrics. Defaults to including all devices. The patterns are matched using globbing.
- Default:
["*"]
- View examples
- Default:
- optionaltable
filesystem
Options for the "filesystem" metrics collector.
- optionaltable
devices
Lists of device name patterns to include or exclude.
- optional[string]
excludes
The list of device name patterns for which to gather usage metrics. Defaults to excluding no devices. The patterns are matched using globbing.
- Default:
[]
- View examples
- Default:
- optional[string]
includes
The list of device name patterns for which to gather usage metrics. Defaults to including all devices. The patterns are matched using globbing.
- Default:
["*"]
- View examples
- Default:
- optionaltable
filesystems
Lists of filesystem name patterns to include or exclude.
- optional[string]
excludes
The list of filesystem name patterns for which to gather usage metrics. Defaults to excluding no filesystems. The patterns are matched using globbing.
- Default:
[]
- View examples
- Default:
- optional[string]
includes
The list of filesystem name patterns for which to gather usage metrics. Defaults to including all filesystems. The patterns are matched using globbing.
- Default:
["*"]
- View examples
- Default:
- optionaltable
mountpoints
Lists of mount point path patterns to include or exclude.
- optional[string]
excludes
The list of mount point path patterns for which to gather usage metrics. Defaults to excluding no mount points. The patterns are matched using globbing.
- Default:
[]
- View examples
- Default:
- optional[string]
includes
The list of mount point path patterns for which to gather usage metrics. Defaults to including all mount points. The patterns are matched using globbing.
- Default:
["*"]
- View examples
- Default:
- optionalstring
namespace
The namespace of metrics. Disabled if empty.
- Syntax:
literal
- Default:
"host"
- Syntax:
- optionaltable
network
Options for the "network" metrics collector.
- optionaltable
devices
Lists of device name patterns to include or exclude.
- optional[string]
excludes
The list of device name patterns for which to gather network utilization metrics. Defaults to excluding no devices. The patterns are matched using globbing.
- Default:
[]
- View examples
- Default:
- optional[string]
includes
The list of device name patterns for which to gather network utilization metrics. Defaults to including all devices. The patterns are matched using globbing.
- Default:
["*"]
- View examples
- Default:
- commonoptionaluint
scrape_interval_secs
The interval between metric gathering, in seconds.
- Default:
15
(seconds)
- Default:
Env Vars
- commonoptionalstring
PROCFS_ROOT
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.- Syntax:
literal
- View examples
- Syntax:
- commonoptionalstring
SYSFS_ROOT
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.- Syntax:
literal
- View examples
- Syntax:
Output
This component outputs the following metric events:
- counter
host_cpu_seconds_total
The number of CPU seconds accumulated in different operating modes. This metric includes the following tags:
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.
- counter
disk_read_bytes_total
The accumulated number of bytes read in. This metric includes the following tags:
collector
- Which collector this metric comes from.device
- The disk device name.host
- The hostname of the originating system.
- counter
disk_reads_completed_total
The accumulated number of read operations completed. This metric includes the following tags:
collector
- Which collector this metric comes from.device
- The disk device name.host
- The hostname of the originating system.
- counter
disk_written_bytes_total
The accumulated number of bytes written out. This metric includes the following tags:
collector
- Which collector this metric comes from.device
- The disk device name.host
- The hostname of the originating system.
- counter
disk_writes_completed_total
The accumulated number of write operations completed. This metric includes the following tags:
collector
- Which collector this metric comes from.device
- The disk device name.host
- The hostname of the originating system.
- gauge
filesystem_free_bytes
The number of bytes free on the named filesystem. This metric includes the following tags:
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.
- gauge
filesystem_total_bytes
The total number of bytes in the named filesystem. This metric includes the following tags:
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.
- gauge
filesystem_used_bytes
The number of bytes used on the named filesystem. This metric includes the following tags:
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.
- gauge
load1
System load averaged over the last 1 second. This metric includes the following tags:
collector
- Which collector this metric comes from.host
- The hostname of the originating system.
- gauge
load5
System load averaged over the last 5 seconds. This metric includes the following tags:
collector
- Which collector this metric comes from.host
- The hostname of the originating system.
- gauge
load15
System load averaged over the last 15 seconds. This metric includes the following tags:
collector
- Which collector this metric comes from.host
- The hostname of the originating system.
- gauge
uptime
The number of seconds since the last boot. This metric includes the following tags:
collector
- Which collector this metric comes from.host
- The hostname of the originating system.
- gauge
boot_time
The UNIX timestamp of the last boot. This metric includes the following tags:
collector
- Which collector this metric comes from.host
- The hostname of the originating system.
- gauge
memory_active_bytes
The number of bytes of active main memory. This metric includes the following tags:
collector
- Which collector this metric comes from.host
- The hostname of the originating system.
- gauge
memory_available_bytes
The number of bytes of main memory available. This metric includes the following tags:
collector
- Which collector this metric comes from.host
- The hostname of the originating system.
- gauge
memory_buffers_bytes
The number of bytes of main memory used by buffers. This metric includes the following tags:
collector
- Which collector this metric comes from.host
- The hostname of the originating system.
- gauge
memory_cached_bytes
The number of bytes of main memory used by cached blocks. This metric includes the following tags:
collector
- Which collector this metric comes from.host
- The hostname of the originating system.
- gauge
memory_free_bytes
The number of bytes of main memory not used. This metric includes the following tags:
collector
- Which collector this metric comes from.host
- The hostname of the originating system.
- gauge
memory_inactive_bytes
The number of bytes of main memory that is not active. This metric includes the following tags:
collector
- Which collector this metric comes from.host
- The hostname of the originating system.
- gauge
memory_shared_bytes
The number of bytes of main memory shared between processes. This metric includes the following tags:
collector
- Which collector this metric comes from.host
- The hostname of the originating system.
- gauge
memory_swap_free_bytes
The number of free bytes of swap space. This metric includes the following tags:
collector
- Which collector this metric comes from.host
- The hostname of the originating system.
- counter
memory_swapped_in_bytes_total
The number of bytes that have been swapped in to main memory. This metric includes the following tags:
collector
- Which collector this metric comes from.host
- The hostname of the originating system.
- counter
memory_swapped_out_bytes_total
The number of bytes that have been swapped out from main memory. This metric includes the following tags:
collector
- Which collector this metric comes from.host
- The hostname of the originating system.
- gauge
memory_swap_total_bytes
The total number of bytes of swap space. This metric includes the following tags:
collector
- Which collector this metric comes from.host
- The hostname of the originating system.
- gauge
memory_swap_used_bytes
The number of used bytes of swap space. This metric includes the following tags:
collector
- Which collector this metric comes from.host
- The hostname of the originating system.
- gauge
memory_total_bytes
The total number of bytes of main memory. This metric includes the following tags:
collector
- Which collector this metric comes from.host
- The hostname of the originating system.
- gauge
memory_used_bytes
The number of bytes of main memory used by programs or caches. This metric includes the following tags:
collector
- Which collector this metric comes from.host
- The hostname of the originating system.
- gauge
memory_wired_bytes
The number of wired bytes of main memory. This metric includes the following tags:
collector
- Which collector this metric comes from.host
- The hostname of the originating system.
- gauge
network_receive_bytes_total
The number of bytes received on this interface. This metric includes the following tags:
collector
- Which collector this metric comes from.device
- The network interface device name.host
- The hostname of the originating system.
- gauge
network_receive_errs_total
The number of errors encountered during receives on this interface. This metric includes the following tags:
collector
- Which collector this metric comes from.device
- The network interface device name.host
- The hostname of the originating system.
- gauge
network_receive_packets_total
The number of packets received on this interface. This metric includes the following tags:
collector
- Which collector this metric comes from.device
- The network interface device name.host
- The hostname of the originating system.
- gauge
network_transmit_bytes_total
The number of bytes transmitted on this interface. This metric includes the following tags:
collector
- Which collector this metric comes from.device
- The network interface device name.host
- The hostname of the originating system.
- gauge
network_transmit_errs_total
The number of errors encountered during transmits on this interface. This metric includes the following tags:
collector
- Which collector this metric comes from.device
- The network interface device name.host
- The hostname of the originating system.
- gauge
network_transmit_packets_drop_total
The number of packets dropped during transmits on this interface. This metric includes the following tags:
collector
- Which collector this metric comes from.device
- The network interface device name.host
- The hostname of the originating system.
- gauge
network_transmit_packets_total
The number of packets transmitted on this interface. This metric includes the following tags:
collector
- Which collector this metric comes from.device
- The network interface device name.host
- The hostname of the originating system.
Telemetry
This component provides the following metrics that can be retrieved through
the internal_metrics
source. See the
metrics section in the
monitoring page for more info.
- counter
processed_events_total
The total number of events processed by this component. This metric includes the following tags:
component_kind
- The Vector component kind.component_name
- The Vector component ID.component_type
- The Vector component type.file
- The file that produced the errorinstance
- The Vector instance identified by host and port.job
- The name of the job producing Vector metrics.
- counter
events_out_total
The total number of events emitted by this component. This metric includes the following tags:
component_kind
- The Vector component kind.component_name
- The Vector component ID.component_type
- The Vector component type.instance
- The Vector instance identified by host and port.job
- The name of the job producing Vector metrics.
How It Works
Context
By default, the host_metrics
source will augment events with helpful
context keys as shown in the "Output" section.
State
This component is stateless, meaning its behavior is consistent across each input.