Statsd Source

The Vector statsd source ingests data through the StatsD UDP protocol and outputs metric events.

Configuration

vector.toml
[sources.my_source_id]
type = "statsd" # must be: "statsd"
address = "127.0.0.1:8126" # example

Options

commonstringrequired

address

UDP socket address to bind to.

No default
View examples

Output

The statsd source ingests data through the StatsD UDP protocol and outputs metric events. For example:

  • Counter
  • Gauge
  • Set
  • Timer

Given the following input:

login.invocations:1|c

A metric event will be output with the following structure:

{
"name": "login.invocations",
"kind": "incremental",
"timestamp": "2019-05-02T12:22:46.658503Z" // current time / time ingested
"value": {
"type": "counter",
"value": 1.0
}
}

How It Works

Environment Variables

Environment variables are supported through all of Vector's configuration. Simply add ${MY_ENV_VAR} in your Vector configuration file and the variable will be replaced before being evaluated.

You can learn more in the Environment Variables section.

Timestamp

StatsD protocol does not provide support for sending metric timestamps. You'll notice that each parsed metric is assigned a null timestamp, which is a special value which means "a real time metric" (not historical one). Normally such null timestamps will be substituted by current time by downstream sinks or 3rd party services during sending/ingestion. See the metric data model page for more info.