prometheus /statsd_exporter
StatsD to Prometheus metrics exporter
★ 990⑂ 264👁 16⑃ 541● 223▤ 56
More from this author
+0
Daily
990
stars
264
forks
16
watchers
541
prs
223
issues
56
releases
README
StatsD exporter
![Docker Repository on Quay][quay]
![Docker Pulls][hub]
statsd_exporter receives StatsD-style metrics and exports them as Prometheus metrics.
Overview
The StatsD exporter is a drop-in replacement for StatsD.
This exporter translates StatsD metrics to Prometheus metrics via configured mapping rules.
We recommend using the exporter only as an intermediate solution, and switching to native Prometheus instrumentation in the long term.
While it is common to run centralized StatsD servers, the exporter works best as a sidecar.
Transitioning from an existing StatsD setup
The relay feature allows for a gradual transition.
Introduce the exporter by adding it as a sidecar alongside the application instances.
In Kubernetes, this means adding it to the pod.
Use the --statsd.relay.address to forward metrics to your existing StatsD UDP endpoint.
Relaying forwards statsd events unmodified, preserving the original metric name and tags in any format.
+-------------+ +----------+ +------------+
| Application +---| Exporter +-----------------| StatsD |
+-------------+ +----------+ +------------+
^
| +------------+
+----------------------+ Prometheus |
+------------+
Relaying from StatsD
To pipe metrics from an existing StatsD environment into Prometheus, configure StatsD's repeater backend to repeat all received metrics to a statsd_exporter process.
+----------+ +-------------------+ +--------------+
| StatsD |---(UDP/TCP repeater)---| statsd_exporter | Prometheus gauge
StatsD counter - Prometheus counter
StatsD timer, histogram, distribution - Prometheus summary or histogram
Glob matching
The default (and fastest) glob mapping style uses to denote parts of the statsd metric name that may vary.
These varying parts can then be referenced in the construction of the Prometheus metric name and labels.
An example mapping configuration:
yaml
mappings:
- match: "test.dispatcher..."
name: "dispatcher_events_total"
labels:
processor: "$1"
action: "$2"
outcome: "$3"
job: "test_dispatcher"
- match: ".signup.."
name: "signup_events_total"
labels:
provider: "$2"
outcome: "$3"
job: "${1}_server"
This would transform these example StatsD metrics into Prometheus metrics as
follows:
test.dispatcher.FooProcessor.send.success
= dispatcher_events_total{processor="FooProcessor", action="send", outcome="success", job="test_dispatcher"}
foo_product.signup.facebook.failure
= signup_events_total{provider="facebook", outcome="failure", job="foo_product_server"}
test.web-server.foo.bar
= test_web_server_foo_bar{}
Each mapping in the configuration file must define a name for the metric. The
metric's naTop issues
#460Why default to summary rather than histogram?11 comments · 2022-08-25#183Support "set" metric type10 comments · 2019-02-05#565Gauge to track the current number of metrics known [was: metricsCount metric remain the same after metric been deleted by RemoveStaleMetrics]5 comments · 2024-07-23#457Lifecycle quit sometimes doesn't work5 comments · 2022-08-11#413Add TLS for the web UI + metrics5 comments · 2021-12-01#471bug: Configuration reload does not affect bucket configuration4 comments · 2022-09-28#481Support prefixed glob matches3 comments · 2023-01-11#475High memory usage for large configuration using glob as matcher type3 comments · 2022-11-11
Latest release
0.31.0 v0.31.0 2026-09-02What's Changed [FEATURE] Support the optional DogStatsD v1.3 metric timestamp field (|T) (716) [FEATURE] Support $0 template reference in glob mappings, expanding to the complete StatsD metric name (matching regex mappings, where $0 expands to the complete regex match) (735) ⚠️ [CHANGE][library] fsm.TemplateFormatter.Format now takes the original metric name as an additional first argument: Format(metricName string, captures []string) instead of Format(captures []string) (735) [CHANGE] Reject unknown mapping configuration fields and remove support for deprecated timer_type, top-level b