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
examples Added StatsdClient Kotlin implementation May 2, 2018
lib Convert codebase from var -> let / const (#673) May 29, 2019
packager Force statsd restart when updating package Nov 11, 2015
servers Convert codebase from var -> let / const (#673) May 29, 2019
test run tests using python 3.7's pickle rather than 2.x cPickle (#669) Mar 25, 2019
utils removes -q switch Dec 19, 2016
.dockerignore update dockerfile to latest node-lts Apr 2, 2019
.gitignore Update: ignore files Jan 14, 2017
.pkgr.yml Remove all default dependencies in generated package Nov 11, 2015
.travis.yml test and declare support for Current and LTS node May 30, 2019 Create Feb 12, 2019 move contributing information into Jan 29, 2014 Updates changelogs. closes #568 May 11, 2016
DCO.txt Create DCO.txt Feb 12, 2019
Dockerfile update dockerfile to latest node-lts Apr 2, 2019
LICENSE Updated copyright to 2016 Jan 1, 2016 Add myself (elliot blackburn) to (#666) Mar 7, 2019 test and declare support for Current and LTS node May 30, 2019
docker-compose.yml Initial Docker Compose manifest. Apr 29, 2016
exampleConfig.js Merge pull request #564 from Nihn/allow-to-use-unix-domain-so May 5, 2016
exampleProxyConfig.js properly use ipv6 config when starting proxy, adds extra keys to exam… Mar 23, 2016
package.json correct npm test script Apr 29, 2019
proxy.js drop statsd instance from proxy ring in instance of healthcheck failu… Mar 13, 2019
run_tests.js Correct reporter decleration in test runner May 29, 2019
stats.js correct backend flush loop May 30, 2019

StatsD Build Status Join the chat at

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 (All Current and LTS Node.js versions are supported.)
  • 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.