StatsD

Collect logs emitted by the StatsD aggregator

status: stable role: aggregator delivery: best effort egress: stream state: stateless output: metrics

Configuration

Example configurations

{
  "sources": {
    "my_source_id": {
      "type": "statsd",
      "address": "0.0.0.0:8125",
      "mode": "tcp",
      "path": "/path/to/socket"
    }
  }
}
[sources.my_source_id]
type = "statsd"
address = "0.0.0.0:8125"
mode = "tcp"
path = "/path/to/socket"
---
sources:
  my_source_id:
    type: statsd
    address: 0.0.0.0:8125
    mode: tcp
    path: /path/to/socket
{
  "sources": {
    "my_source_id": {
      "type": "statsd",
      "address": "0.0.0.0:8125",
      "mode": "tcp",
      "path": "/path/to/socket",
      "receive_buffer_bytes": 65536,
      "shutdown_timeout_secs": 30
    }
  }
}
[sources.my_source_id]
type = "statsd"
address = "0.0.0.0:8125"
mode = "tcp"
path = "/path/to/socket"
receive_buffer_bytes = 65_536
shutdown_timeout_secs = 30
---
sources:
  my_source_id:
    type: statsd
    address: 0.0.0.0:8125
    mode: tcp
    path: /path/to/socket
    receive_buffer_bytes: 65536
    keepalive: null
    shutdown_timeout_secs: 30

address

required string literal
The address to listen for connections on, or systemd#N to use the Nth socket passed by systemd socket activation. If an address is used it must include a port.
Examples
"0.0.0.0:8125"
"systemd"
"systemd#3"
Relevant when: mode = `tcp` or `udp`

keepalive

optional object
Configures the TCP keepalive behavior for the connection to the source.

keepalive.time_secs

optional uint
The time a connection needs to be idle before sending TCP keepalive probes.

mode

required string literal enum
The type of socket to use.
Examples
"tcp"
"udp"
"unix"
Enum options string literal
OptionDescription
tcpTCP Socket.
udpUDP Socket.
unixUnix Domain Socket.

path

required string literal
The unix socket path. This should be an absolute path.
Examples
"/path/to/socket"
Relevant when: mode = `unix`

receive_buffer_bytes

optional uint
Configures the receive buffer size using the SO_RCVBUF option on the socket.
Examples
65536
Relevant when: mode = `tcp` or mode = `udp`

shutdown_timeout_secs

optional uint
The timeout before a connection is forcefully closed during shutdown.
default: 30 (seconds)
Relevant when: mode = `tcp`

Output

Metrics

counter

counter
A single value that can be incremented or reset to a zero value but not decremented.
* optional
Any tags present on the metric.

distribution

distribution
A distribution represents a distribution of sampled values. It is used with services that support global histograms and summaries.
* optional
Any tags present on the metric.

gauge

gauge
A gauge represents a point-in-time value that can increase and decrease. Vector’s internal gauge type represents changes to that value. Gauges should be used to track fluctuations in values, like current memory or CPU usage.
* optional
Any tags present on the metric.

set

gauge
A set represents an array of unique values.
* optional
Any tags present on the metric.

Telemetry

Metrics

link

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 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.
container_name optional
The name of the container from which the event originates.
file optional
The file from which the event originates.
host required
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 event originates.
peer_path optional
The pathname from which the event originates.
pid required
The process ID of the Vector instance.
pod_name optional
The name of the pod from which the event originates.
uri optional
The sanitized URI from which the event originates.

component_sent_event_bytes_total

counter
The total number of event bytes 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.

component_sent_events_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.

connection_errors_total

counter
The total number of connection errors for this Vector instance.
host required
The hostname of the system Vector is running on.
pid required
The process ID of the Vector instance.

events_in_total

counter
The number of events accepted by this component either from tagged origins like file and uri, or cumulatively from other origins. This metric is deprecated and will be removed in a future version. Use component_received_events_total instead.
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.
container_name optional
The name of the container from which the event originates.
file optional
The file from which the event originates.
host required
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 event originates.
peer_path optional
The pathname from which the event originates.
pid required
The process ID of the Vector instance.
pod_name optional
The name of the pod from which the event originates.
uri optional
The sanitized URI from which the event originates.

events_out_total

counter
The total number of events emitted by this component. This metric is deprecated and will be removed in a future version. Use component_sent_events_total instead.
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.

invalid_record_bytes_total

counter
The total number of bytes from invalid records that have been discarded.
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.

invalid_record_total

counter
The total number of invalid records that have been discarded.
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_bytes_total

counter
The number of bytes processed by the 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.
container_name optional
The name of the container from which the bytes originate.
file optional
The file from which the bytes originate.
host required
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 bytes originate.
peer_path optional
The pathname from which the bytes originate.
pid required
The process ID of the Vector instance.
pod_name optional
The name of the pod from which the bytes originate.
uri optional
The sanitized URI from which the bytes originate.

processed_events_total

counter
The total number of events processed by this component. This metric is deprecated in place of using component_received_events_total and component_sent_events_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.

How it works

Context

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

State

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

Timestamps

The StatsD protocol doesn’t provide support for sending metric timestamps. You may notice that each parsed metric is assigned a null timestamp, which is a special value indicating a realtime metric (i.e. not a historical metric). Normally, such null timestamps are substituted with the current time by downstream sinks or third-party services during sending/ingestion. See the metric data model page for more info.