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",
      "shutdown_timeout_secs": 30
    }
  }
}
[sources.my_source_id]
type = "statsd"
address = "0.0.0.0:8125"
mode = "tcp"
path = "/path/to/socket"
shutdown_timeout_secs = 30
---
sources:
  my_source_id:
    type: statsd
    address: 0.0.0.0:8125
    mode: tcp
    path: /path/to/socket
    keepalive: null
    shutdown_timeout_secs: 30

address

required string
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.

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 enum
The type of socket to use.
Enum options string literal
OptionDescription
tcpTCP Socket.
udpUDP Socket.
unixUnix Domain Socket.

path

required string
The unix socket path. This should be an absolute path.

shutdown_timeout_secs

optional uint
The timeout before a connection is forcefully closed during shutdown.
default: 30 (seconds)

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

connection_errors_total

counter
The total number of connection errors for this Vector instance.

events_in_total

counter
The number of events accepted by this component either from tagged origin like file and uri, or cumulatively from other origins.
component_kind required
The Vector component kind.
component_name required
The Vector component name.
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.
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.
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.
component_kind required
The Vector component kind.
component_name required
The Vector component name.
component_type required
The Vector component type.

invalid_record_bytes_total

counter
The total number of bytes from invalid records that have been discarded.
component_kind required
The Vector component kind.
component_name required
The Vector component name.
component_type required
The Vector component type.

invalid_record_total

counter
The total number of invalid records that have been discarded.
component_kind required
The Vector component kind.
component_name required
The Vector component name.
component_type required
The Vector component type.

processed_bytes_total

counter
The number of bytes processed by the component.
component_kind required
The Vector component kind.
component_name required
The Vector component name.
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.
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.
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 events_in_total and events_out_total metrics.
component_kind required
The Vector component kind.
component_name required
The Vector component name.
component_type required
The Vector component type.

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 timestmap, 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.