METRIC

statsd source

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

Configuration

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

Options

commonstringrequired

address

UDP socket address to bind to.

No default
View examples

Output

This component outputs metric events.

  • Counter
  • Gauge
  • Set
  • Timer/Histogram

Given the following input:

login.invocations:1|c

A metric event will be output with the following structure:

{
"counter": {
"name": "login.invocations",
"val": 1,
"timestamp": "2019-05-02T12:22:46.658503Z" // current time / time ingested
}
}

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

You'll notice that each metric contains a timestamp field. This is an optional descriptive field that represents when the metric was received. It helps to more closely represent the metric's time in situations here it can be used. See the metric data model page for more info.