EN
Back to the archive

The encyclopedia · Software & IT · Technical decision · 2011

Etsy's StatsD made metrics free to add: one UDP line, aggregated in buckets

Etsy's 2011 StatsD daemon takes one-line UDP counters and timers, aggregates them in 10-second buckets, and made measuring anything a one-line change.

Etsy

the move

Etsy was deploying code dozens of times a day and needed to know what it was doing. Instead of planning a configuration-managed metrics system up front, it made measuring ridiculously simple: any engineer could get anything they could count or time into a graph in about half an hour. The tool was StatsD, a deliberately simple Node.js daemon released with the 2011 post "Measure Anything, Measure Everything."

The design choice was UDP plus server-side aggregation. A client fires a tiny plain-text message — a counter, timer or gauge — and forgets about it: "Either StatsD gets the data, or it doesn't. The application doesn't care if StatsD is up, down, or on fire." The daemon sums events into time buckets and flushes aggregates to Graphite every 10 seconds, so metrics are near-realtime and a new metric appears with no configuration.

Sampling was added for very frequent events: send only a fraction of packets and let StatsD scale the numbers back to a 100% estimate before flushing. The protocol stayed so small that the idea spread across companies, and the open-source daemon became the basis of a whole ecosystem of compatible implementations.

why it works

  • Fire-and-forget UDP means instrumentation can never slow a request or take down the site.
  • Aggregation happens in one daemon, so storage gets sums, not millions of packets.
  • New metrics appear in Graphite with no config — one line of code.
  • Sampling keeps high-frequency events measurable without flooding the network.
the payoffOne UDP line per metric; aggregate server-sideclever

what transfers

Lower the cost of a measurement to one line and people will measure everything; push the expensive aggregation into a background daemon so the app never pays for its own observability.

what came after

StatsD became one of the most widely copied pieces of monitoring infrastructure: client libraries exist for most languages, compatible servers and proxies are standard, and its text protocol influenced later metrics ecosystems. Etsy's engineering story remains the canonical example of making observability cheap enough that teams actually use it.

references

spotted an error? The archive wants to know.

same kind of clever