Statsd Source

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

Requirements

Configuration

vector.toml
[sources.my_source_id]
type = "statsd" # required
address = "127.0.0.1:8126" # required
  • stringcommonrequired

    address

    UDP socket address to bind to.

    • No default
    • View examples

Examples

Given the following input:

Example input
login.invocations:1|c

A metric event will be output with the following structure:

Example metric event
{
"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", i.e. not a 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.