Skip to main content

statsd

Pushes metrics using the StatsD protocol. Supported tagging formats are 'legacy', 'none', 'datadog' and 'influxdb'.

# Config fields, showing default values
metrics:
statsd:
prefix: benthos
path_mapping: ""
address: localhost:4040
flush_period: 100ms
tag_format: legacy

The underlying client library has recently been updated in order to support tagging. The tag format 'legacy' is default and causes Benthos to continue using the old library in order to preserve backwards compatibility.

The legacy library aggregated timing metrics, so dashboards and alerts may need to be updated when migrating to the new library.

The 'network' field is deprecated and scheduled for removal. If you currently rely on sending Statsd metrics over TCP and want it to be supported long term please raise an issue.

Fields​

prefix​

A string prefix to add to all metrics.

Type: string
Default: "benthos"

path_mapping​

An optional Bloblang mapping that allows you to rename or prevent certain metrics paths from being exported. When metric paths are created, renamed and dropped a trace log is written, enabling TRACE level logging is therefore a good way to diagnose path mappings.

Type: string
Default: ""

# Examples
path_mapping: this.replace("input", "source").replace("output", "sink")
path_mapping: |-
if ![
"benthos.input.received",
"benthos.input.latency",
"benthos.output.sent"
].contains(this) { deleted() }

address​

The address to send metrics to.

Type: string
Default: "localhost:4040"

flush_period​

The time interval between metrics flushes.

Type: string
Default: "100ms"

tag_format​

Metrics tagging is supported in a variety of formats. The format 'legacy' is a special case that forces Benthos to use a deprecated library for backwards compatibility.

Type: string
Default: "legacy"
Options: none, datadog, influxdb, legacy.