prometheus /statsd_exporter

StatsD to Prometheus metrics exporter

★ 990⑂ 264👁 16⑃ 541● 223▤ 56
GoApache-2.0Created 2013-07-02
下载:0.31.00.31.0 ↓0.31.02026-09-02
+0
日增长
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 na

Top issues

Latest release

0.31.0 v0.31.0 2026-09-02
What'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

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON