statsd source

Ingests data through the StatsD UDP protocol and outputs `metric` events.

The statsd source is in beta. Please see the current enhancements and bugs for known issues. We kindly ask that you add any missing issues as it will help shape the roadmap of this component.

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

Config File

vector.toml (simple)
vector.toml (advanced)
[sources.my_source_id]
type = "statsd" # must be: "statsd"
address = "127.0.0.1:8126"
# For a complete list of options see the "advanced" tab above.

Examples

Counter
Gauge
Set
Timer

Given the following Statsd counter:

login.invocations:1|c

A metric event will be emitted with the following structure:

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

Given the following Statsd gauge:

gas_tank:0.50|g

A metric event will be emitted with the following structure:

metric
{
"gauge": {
"name": "gas_tank",
"val": 0.5,
"timestamp": "2019-05-02T12:22:46.658503Z" // current time / time ingested
}
}

Given the following Statsd set:

unique_users:foo|s

A metric event will be emitted with the following structure:

metric
{
"set": {
"name": "unique_users",
"val": 1,
"timestamp": "2019-05-02T12:22:46.658503Z" // current time / time ingested
}
}

Given the following Statsd timer:

login.time:22|ms

A metric event will be emitted with the following structure:

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

How It Works

Delivery Guarantee

Due to the nature of this component, it offers a best effort delivery guarantee.

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.

Troubleshooting

The best place to start with troubleshooting is to check the Vector logs. This is typically located at /var/log/vector.log, then proceed to follow the Troubleshooting Guide.

If the Troubleshooting Guide does not resolve your issue, please:

  1. If encountered a bug, please file a bug report.

  2. If encountered a missing feature, please file a feature request.

  3. If you need help, join our chat/forum community. You can post a question and search previous questions.

Resources