Skip to content
Daemon for easy but powerful stats aggregation
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
backends pickling support. Jul 10, 2015
bin add bin/statsd Jun 28, 2012
debian Updates changelogs. closes #568 May 11, 2016
docs Merge pull request #663 from BlueHatbRit/patch-1 Feb 26, 2019
examples Added StatsdClient Kotlin implementation May 2, 2018
lib Fix for failing test on node 0.10 Nov 21, 2016
servers Fix node 0.10 error. May 5, 2016
test Merge pull request #564 from Nihn/allow-to-use-unix-domain-so May 5, 2016
utils removes -q switch Dec 19, 2016
.dockerignore Update: ignore files Jan 14, 2017
.pkgr.yml Remove all default dependencies in generated package Nov 11, 2015
.travis.yml Updates changelogs. closes #568 May 11, 2016
LICENSE Merge pull request #654 from lpmi-13/typofix Feb 14, 2019
exampleConfig.js Merge pull request #564 from Nihn/allow-to-use-unix-domain-so May 5, 2016
package.json increment version to 0.8.1 Mar 13, 2019
proxy.js Make failing tests exit with non-zero status Jul 21, 2012
stats.js Account for negative clock skew in flushMetrics May 7, 2016

StatsD Build Status

A network daemon that runs on the Node.js platform and listens for statistics, like counters and timers, sent over UDP or TCP and sends aggregates to one or more pluggable backend services (e.g., Graphite).

Key Concepts

  • buckets Each stat is in its own "bucket". They are not predefined anywhere. Buckets can be named anything that will translate to Graphite (periods make folders, etc)

  • values Each stat will have a value. How it is interpreted depends on modifiers. In general values should be integers.

  • flush After the flush interval timeout (defined by config.flushInterval, default 10 seconds), stats are aggregated and sent to an upstream backend service.

Installation and Configuration

  • Install node.js
  • Clone the project
  • Create a config file from exampleConfig.js and put it somewhere
  • Start the Daemon:
    node stats.js /path/to/config


The basic line protocol expects metrics to be sent in the format:


So the simplest way to send in metrics from your command line if you have StatsD running with the default UDP server on localhost would be:

echo "foo:1|c" | nc -u -w0 8125

More Specific Topics


There are additional config variables available for debugging:

  • debug - log exceptions and print out more diagnostic info
  • dumpMessages - print debug info on incoming messages

For more information, check the exampleConfig.js.


A test framework has been added using node-unit and some custom code to start and manipulate statsd. Please add tests under test/ for any new features or bug fixes encountered. Testing a live server can be tricky, attempts were made to eliminate race conditions but it may be possible to encounter a stuck state. If doing dev work, a killall statsd will kill any stray test servers in the background (don't do this on a production machine!).

Tests can be executed with ./


statsd was originally written at (Etsy) and released with a blog post about how it works and why we created it.


StatsD was inspired (heavily) by the project (of the same name) at Flickr. Here's a post where Cal Henderson described it in depth: Counting and timing Cal re-released the code recently: Perl StatsD

You can’t perform that action at this time.