Migrating from StatsD to Prometheus

A planned path from StatsD to Prometheus that keeps existing senders working while mapping metric names to labels, then moves services to native client libraries.

On this page

Migrating from StatsD to Prometheus: what the move involves

If your services send metrics to StatsD and feed dashboards and alerts from there, you can bridge those senders into Prometheus with the statsd_exporter as an intermediate step, so existing instrumentation keeps working while you move. The total effort depends mostly on how many StatsD metric names, dashboards and alert rules must be remapped to Prometheus names, labels and PromQL, and on how many teams own the senders. Start by exporting the full list of metric names and the dashboards and alerts that read them, then count how many of those names carry dimensions that StatsD encoded in the name itself, since those need explicit mapping rules. That inventory is the single best input for a quote, and it is worth asking any partner to produce it as the first deliverable.

The statsd_exporter is a stepping stone, not the destination. It is a drop-in replacement for StatsD that translates incoming StatsD metrics into Prometheus metrics through mapping rules, and it works best as a sidecar next to the application or host that sends the metrics. Its maintainers recommend it only as an intermediate step before native Prometheus instrumentation, which means the exporter's mapping file becomes a maintenance burden if you stop there. Plan each service's move to a Prometheus client library as a separate, tracked item, and treat the mapping rules as temporary scaffolding with a retirement date. Confirm the exporter's current options and mapping syntax against the statsd_exporter repository before you write any rules, because the behavior you test on day one should match what you deploy.

Running both pipelines during cutover is where most of the risk sits. The --statsd.relay.address option forwards events unmodified to an existing StatsD endpoint, so you can point senders at the exporter while dashboards and alerts on the old server keep receiving data. Compare the two sides for each metric before you retire anything, paying attention to rates, timer semantics and histogram buckets, which StatsD and Prometheus treat differently. Assign an owner to each alert that is moving, and do not decommission the StatsD server until every dashboard and alert that depended on it has been rebuilt and checked against live data.

Which StatsD concepts map cleanly to Prometheus and which need redesign

This table compares StatsD metric types, naming and aggregation behavior with their Prometheus equivalents. Read each row as a question to answer before writing mapping rules: rows marked as a clean mapping can be translated by statsd_exporter, while rows marked for redesign need a decision about labels, PromQL or instrumentation.

StatsD conceptPrometheus equivalentMigration effortWhat to confirm
Counter (increments per flush)Counter, queried with rate() or increase()Low: maps cleanlyWhether consumers read raw per-interval values or rates, since StatsD emits deltas and Prometheus stores cumulative totals
Gauge (last value set)GaugeLow: maps cleanlyGauges with +/- deltas behave differently, so confirm senders do not rely on relative updates
Timer (per-flush percentiles)Histogram or summary, queried with histogram_quantile()Medium: needs redesignPercentiles computed by StatsD per flush cannot be recombined across instances, so plan histogram buckets instead
Set (unique value count)No direct type; use a counter of unique values or a sampled approachHigh: needs redesignWhether cardinality of the set members is bounded, since unbounded sets create many series
Dotted name (service.endpoint.metric)Metric name plus labels, set by mapping rulesMedium: mapping rules requiredWhich name segments are dimensions (for example, endpoint or status) and which belong in the metric name
Tags or dimensions (DogStatsD style)Labels, with cardinality limitsMedium: check label valuesWhether high-cardinality tags such as user IDs or request IDs must be dropped or kept out of metrics
Flush interval (for example, 10 seconds)Scrape interval and rate windows in PromQLLow: change in dashboardsAlert thresholds and dashboards written against per-flush values, which change meaning under rate windows
Aggregation done by StatsD (sum, mean, percentiles)PromQL aggregation, recording rules, or histogramsHigh: needs PromQL or recording rulesWhich aggregates dashboards and alerts depend on, and whether they can be rebuilt from raw series

Documented tools for the StatsD to Prometheus bridge

The migration rests on a small set of documented components: the exporter that translates StatsD traffic, the relay that keeps the old pipeline alive, the scrape job that pulls the results, and the native client libraries that become the long-term destination. Each card covers one of these pieces and what to verify before relying on it.

statsd_exporter as a drop-in receiver

The statsd_exporter accepts the StatsD line protocol that existing senders already emit and converts each metric into a Prometheus metric. Because senders keep their current configuration, services do not change during the first phase. Check which StatsD metric types your senders use, since timers, counters and gauges map to Prometheus types differently and dashboards built on the old names will need review.

statsd_exporter repository

Mapping rules for names and labels

Mapping rules tell the exporter how to split a dotted StatsD name into a metric name and labels, such as turning a service and endpoint segment into a label value. Well-designed rules keep label sets small and bounded. Poorly designed rules can create a label for every user or request ID, which increases series count quickly. Test the rules against a sample of real sender traffic and review the resulting label values before cutover.

Sidecar deployment pattern

Running the exporter as a sidecar places it next to the service that sends metrics, so each service has a predictable local UDP or TCP target and the exporter's lifecycle follows the service. Confirm how your platform handles port allocation, restart behavior and resource limits for the extra container. Sidecars multiply the number of processes to patch and monitor, so the team should weigh that against a shared exporter per host or cluster.

The --statsd.relay.address option

The --statsd.relay.address flag forwards each received event unmodified to an existing StatsD endpoint. Teams can keep the old dashboards and alerts working while Prometheus collects the same data. Confirm that the relay target is reachable from the exporter, that the forwarded traffic volume is acceptable to the old server, and that the relay is removed once the old consumers are retired.

Prometheus scrape configuration

Prometheus pulls the exporter's metrics over HTTP through an ordinary scrape job, usually defined with a static_configs target or service discovery. The scrape interval and the target list are the settings to review, along with any relabeling that drops metrics the team does not need. Confirm the job name and the target addresses before moving dashboards, because queries and alert rules depend on both.

Native client libraries as the destination

The exporter's maintainers recommend it as an intermediate step, so the long-term target is native Prometheus instrumentation through the official client libraries. Native instrumentation exposes metrics with proper types and labels set in code, which removes the need for mapping rules. Plan the service-by-service order, retire each mapping rule when its service is re-instrumented, and track which StatsD names still appear in dashboards.

How StatsD senders, the exporter, the relay and Prometheus fit during transition

The diagram starts with services that already send StatsD events. Those events reach the statsd_exporter running as a sidecar, which translates them through mapping rules and exposes metrics for Prometheus to scrape. The exporter's --statsd.relay.address option forwards unmodified events to the legacy StatsD server, so existing dashboards keep working during the parallel run. The later state shows services emitting native Prometheus metrics, with the exporter and relay removed. Check that both paths produce matching values before cutting over.

Parallel run of StatsD relay and exporter, then native Prometheus instrumentation.

How the StatsD cutover runs in phases

The sequence moves StatsD traffic into Prometheus one step at a time, so every metric is checked against the legacy path before anything is switched off. Each phase ends with an output that proves the next one is safe.

  1. Inventory metric names and consumers

    Your platform or monitoring team lists every StatsD metric name, its type (counter, gauge, timer, set), the sending services and the dashboards, alerts and scripts that read it. Keep the list in version control so later steps can check against it. The step is done when every metric has an owner and a named consumer, and any metric with no consumer is marked for removal rather than migrated.

  2. Write and test mapping rules

    Your engineers write statsd_exporter mapping rules that turn dotted StatsD names into Prometheus metric names and labels. Replay captured sample traffic through a test instance and compare the exposed series with the inventory. The step is done when each sample line maps to exactly one expected metric and no unexpected series appear, which you confirm by reviewing the /metrics output from the test run.

  3. Deploy the sidecar with relay enabled

    Deploy statsd_exporter as a sidecar next to each service or host group and configure the --statsd.relay.address option so events still reach the existing StatsD endpoint unmodified. Point the senders at the sidecar and confirm the legacy server still receives the same traffic. The step is done when both paths show current data and the sidecar's scrape endpoint is reachable from Prometheus.

  4. Build Prometheus dashboards and alert rules

    Your team recreates each legacy dashboard panel and alert in Prometheus, written in PromQL, and keeps the StatsD versions running. Owners review each new rule against the old threshold and duration. The step is done when every legacy alert has a Prometheus counterpart that has been reviewed and loaded, and each rule's source is recorded alongside it.

  5. Compare outputs during a parallel run

    Run both pipelines together for a period agreed with the owners, and compare counters, gauges and timers from each path side by side. Investigate every mismatch, including differences caused by flush intervals, timer aggregation or dropped packets. The step is done when the differences are explained and accepted in writing by the metric owners, and no open discrepancy blocks a decision.

  6. Move each service to native client libraries

    Service teams replace StatsD client calls with a Prometheus client library, choosing metric types and labels from the inventory rather than copying the mapped names. Each service is switched over in turn, and the sidecar mapping for it is removed once its native metrics match the legacy output. The step is done when the service's native endpoint is scraped, its dashboards read from it, and the mapping entry is retired.

  7. Decommission the relay and old StatsD server

    Once no service sends to StatsD and no consumer reads from it, remove the --statsd.relay.address setting, stop the sidecars that no longer map anything, and shut down the legacy StatsD server. Keep the configuration and inventory for audit purposes. The step is done when the legacy server receives no traffic over an agreed observation window and its removal is recorded in your change system.

Writing StatsD mapping rules that keep labels consistent

A mapping rule decides which part of a StatsD name becomes the metric name and which parts become labels, so it is the single most important decision in a StatsD to Prometheus move. The statsd_exporter reads a dotted name such as api.checkout.requests.200 and, through the mapping rules in its configuration file, rewrites it into a Prometheus metric name plus label pairs. A rule typically matches the dotted structure with a pattern, keeps the stable segments in the metric name, and moves the variable segments into labels. Every label value that a rule produces becomes a separate time series, which is why the rule set has to be designed around the values that can appear, not only the ones you see today.

The main risk is unbounded identifiers. If a rule captures a user ID, session token, order number, hostname generated per container, or a request path with embedded IDs, each new value creates a new series, and the number of series grows with traffic and with the age of the system. Prometheus documents its own limits on this kind of growth in its operations guidance, so treat cardinality as a design constraint. Before cutover, list every segment that a rule would turn into a label, and for each one confirm that its values come from a short, fixed set such as status classes, regions, or service tiers. Anything else should stay out of labels or be dropped in the mapping. Illustrative example: a path segment with a numeric order ID should be dropped or replaced with a fixed label, not captured as a label.

Test rules against captured traffic before any service moves. Capture a representative sample of StatsD lines from the existing relay or from a staging environment, run them through the exporter, and inspect the names and label sets it emits. Check for metrics that matched no rule, for label values that multiply, and for collisions where two different StatsD names map to the same series. Agree the naming and label conventions with the owners of dashboards and alert rules before cutover, because a renamed metric or label breaks every query that depends on it. Confirm with those owners which label names they filter on and which aggregations they rely on, and record the agreed convention in the same repository as the mapping file.

What drives the cost and duration of a StatsD migration

This table compares the cost components of moving StatsD instrumentation to Prometheus, showing who does the work, whether each cost is one-time or recurring, and what pushes it up or down. Read it before requesting a quote so you can see which inputs your own estimate depends on. The main takeaway is that the number of metric names, alert rules and services moving to native instrumentation usually matters more than the Prometheus software itself, which is Apache-2.0 licensed with no paid edition.

Cost or driverWhat it coversOne-time or recurringWhat to ask for in a quote
Distinct StatsD metric names and sendersEach name needs a mapping rule for the statsd_exporter, and each sender needs a check that its output looks rightOne-timeCount of metric names and senders, and how the quote treats names that need manual mapping
Dashboards and alert rules that reference StatsD namesRewriting queries and alert expressions in PromQL and checking that thresholds still mean the same thingOne-timeNumber of dashboards and alert rules in scope, and whether validation against old data is included
StatsD client libraries and languagesClient versions, languages and build pipelines that differ across services affect how changes are rolled outOne-timeList of languages and client libraries, and which services are covered by the fixed scope
Relay target availabilityKeeping the old StatsD endpoint running through the transition with the exporter's relay option, including its hosting and monitoringRecurring until retiredWho operates the relay target, for how long it runs, and what its retirement depends on
Services moving to native instrumentationCode changes, testing and deployment for each service that replaces StatsD calls with a Prometheus client libraryOne-time per serviceNumber of services in scope and whether instrumentation work is priced separately from mapping work
Team familiarity with PromQLTime spent learning query and alert design, and review cycles needed before alerts are trustedOne-timeWhether training or pairing is included, and who reviews alert rules before cutover
Prometheus server and storageHosting, disk, retention settings and the people who keep the server runningRecurringSizing assumptions for series count and retention, and who owns upgrades and backups
Statsd_exporter sidecarsCompute and configuration for each sidecar, plus updates and monitoring of the exporter itselfRecurringWhere sidecars run, how they are updated, and how their health is monitored

What usually goes wrong in StatsD to Prometheus migrations

Most StatsD to Prometheus problems come from the translation layer rather than from Prometheus itself. The exporter, its mapping rules, the relay and the alerts sit between old and new systems, so each one needs an owner and a check. The cards below cover the failures teams meet most often and the step that prevents each one.

Mapping rules create high-cardinality labels

A broad mapping rule can turn an unbounded StatsD name segment, such as a user ID, request path or hostname, into a Prometheus label. Each distinct value then creates a new time series, which raises memory use and query cost on the Prometheus server. Before cutover, list the label values each mapping produces in a test environment, and reject any rule that captures identifiers. Use explicit mapping rules for every metric family rather than a wildcard catch-all.

statsd_exporter repository

Timers and percentiles drift from legacy values

StatsD computes timer percentiles and aggregates in its own way, and the exporter's histogram or summary output will not match those numbers exactly. Dashboards and SLO thresholds built on the old percentile values can then show a shift that looks like a real change in service behavior. Run both pipelines side by side for a comparison window, and record the differences for each timer before you retire the old graphs.

The exporter stays in place too long

statsd_exporter is intended as an intermediate step, and its maintainers recommend moving to native Prometheus instrumentation afterward. Teams often leave the exporter running indefinitely because it works, which keeps the translation layer and its mapping file as a permanent dependency. Set a dated review for each service that names who moves its code to a native client library and what proves the move is complete.

exporter project page

Renamed metrics silently break alerts

When a mapping changes the name or labels of a metric, any alert rule or recording rule that references the old series stops matching and never fires. Nothing errors visibly, so the gap appears only during an incident. After each mapping change, check every rule file for the old names, and test each critical alert with a synthetic condition so you know it still evaluates against the new series.

Relay target outages during parallel run

The --statsd.relay.address option forwards events unmodified to the existing StatsD endpoint during the transition. If that endpoint goes down, senders may stall or lose data depending on how they handle errors, and the legacy dashboards go blank at the same time. Confirm how each sending client behaves when the relay is unreachable, monitor the relay target itself, and agree on which system is the source of record during the outage.

statsd_exporter repository

Unclear ownership of native instrumentation

The exporter moves metrics along, but someone must own the change that removes StatsD calls from each service and adds native client library instrumentation. Without a named owner per service, the work stalls, and the final state ends up as a mix of exporter-translated and native metrics with inconsistent names. Assign an owner for each service in the migration plan, and define what counts as done, including retired StatsD client code and removed mapping entries.

Questions teams ask before moving from StatsD to Prometheus

How much effort does a StatsD to Prometheus migration usually take?

Effort depends mostly on how many metric names, senders and dashboards you have, and on how many of those names carry meaning you need to keep. The statsd_exporter can accept existing StatsD traffic quickly through a sidecar, so the first step is usually small. The larger cost comes from writing mapping rules that turn dotted StatsD names into Prometheus metric names and labels, checking that each mapping keeps the series your alerts depend on, and rebuilding dashboards and alert rules in PromQL. Services that already have clear naming conventions are cheaper to map than services where one metric name encodes several dimensions. Ask any partner for a written inventory of senders, metric names and dashboards before agreeing on scope, because that inventory sets most of the work.

How long should a parallel run last during a StatsD migration?

The parallel run lasts until your team has confirmed that the Prometheus side reproduces what the StatsD side showed for every dashboard and alert that matters. The statsd_exporter supports a relay option, --statsd.relay.address, which forwards events unmodified to an existing StatsD endpoint, so both systems can receive the same traffic while you compare them. What sets the length is how many services still need checking, how often each one is deployed, and how many alert rules must be proven to fire on the same conditions. Business cycles matter too: a month-end or seasonal peak that your alerts cover should appear in the comparison before you retire the old path. Confirm the exact comparison criteria with your own operations team before the run starts.

What does a StatsD migration need from our internal team?

The work needs people who know three things: which metrics the business relies on, who owns each service that emits them, and how alerts reach on-call staff. Service owners need to confirm the meaning of their metric names and approve the label design. Platform engineers run the sidecar, the relay and the scrape configuration, and they need access to the hosts and the network path between Prometheus and the exporters. Someone must own the mapping rules after the migration, because new metrics will keep arriving. Plan time for these roles before the outside work starts, and ask any partner to name which tasks they expect your staff to perform.

Can our team migrate from StatsD to Prometheus without outside help?

Yes, a team with Prometheus experience and clear ownership of its StatsD estate can do the migration itself. The tasks are well defined: run statsd_exporter as a sidecar, write mapping rules, configure relaying, compare outputs and move services to native client libraries. Teams without Prometheus experience usually spend more time on PromQL, label design and alert rule testing, which is where mistakes cause silent gaps in monitoring. An outside partner is most useful for the inventory, the mapping design and the cutover checks, and for work that competes with the team's normal duties. Compare the cost of your own staff time against a written, fixed scope.

Is statsd_exporter a permanent solution after a StatsD migration?

No, statsd_exporter is meant as an intermediate step. Its maintainers recommend it only while services move toward native Prometheus instrumentation, using the official client libraries in each language. Keeping the exporter long term means your metric names continue to pass through a translation layer, which makes naming and label problems harder to fix at the source. It also keeps an extra component in your monitoring path. A sensible plan moves services one at a time, retires mapping rules as each service changes, and removes the sidecar when no senders remain. Confirm the target timeline with your service owners, since it depends on how many teams must change code.

What happens to our historical StatsD data?

StatsD does not store history itself. It forwards aggregated values to a backend such as Graphite or another time-series store, so historical data usually lives in that backend rather than in StatsD. Prometheus does not import that history automatically when the statsd_exporter starts receiving traffic, so the old data stays where it is until you decide to keep it. Options include keeping the old backend read-only for lookback, exporting history and bringing it into Prometheus with backfilling, or accepting a clean break with the old dashboards archived. Confirm which backend holds your history and which periods your audits and capacity reviews need before choosing.

What should we check in our own environment before starting?

Start by listing every StatsD sender, the metric names it emits, the backend that stores the output, and the dashboards and alert rules that read from it. Then check the network paths the sidecar needs, the retention settings of your current backend, and whether any sender uses tags or formats that the exporter must translate differently. Confirm which teams own each service and who approves label design. Record the version of statsd_exporter you plan to run and check its release notes against your mapping rules before deployment. These checks show the real size of the work and make any quote from a partner comparable to your own estimate.

How DeployOpen scopes and delivers a StatsD to Prometheus migration

DeployOpen plans the StatsD to Prometheus move as a written, fixed-scope engagement inside your own infrastructure. We map each StatsD metric family to its Prometheus name and labels, run the statsd_exporter alongside your existing StatsD endpoint, and document the path toward native client libraries.

How we scope

  • Inventory every service that emits StatsD metrics, including its metric types, tags and sending library.
  • Agree mapping rule ownership, naming conventions and the label set that dashboards and alerts will depend on.
  • Set the written scope, deliverables and timeline before any configuration changes are made in your environment.

How we build

  • Deploy statsd_exporter as a sidecar and write mapping rules tested against sample traffic from real services.
  • Configure relaying to the existing StatsD endpoint so current dashboards and consumers keep receiving data during transition.
  • Compare old and new series side by side and confirm values, counts and label cardinality before cutover.

How we hand over

  • Deliver the mapping rule set, sidecar configuration and runbook with version control and change procedures.
  • Document which services remain on StatsD, which have moved to native client libraries and what remains open.
  • Walk your platform, operations and security teams through the handover and the retirement checklist for StatsD.

How we support

  • Offer ongoing support, upgrades and continuous testing for the exporter and Prometheus setup as a retainer.
  • Plan the rollout of native client library instrumentation service by service, with an agreed scope for each step.
  • Confirm with your team which support terms, response expectations and access arrangements apply before work begins.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.