Simple daemon for easy stats aggregation
Перейти к файлу
Patrick Scharrenberg 845c129a9f create log directory on startup as statsd does not start without it 2014-03-21 11:43:04 +01:00
backends Enhancement: consume logger in graphite and repeater backends 2013-12-07 00:12:22 +01:00
bin add bin/statsd 2012-06-28 16:07:37 +02:00
debian create log directory on startup as statsd does not start without it 2014-03-21 11:43:04 +01:00
docs fixed a link 2013-12-31 13:51:12 +01:00
examples Julia statsd client implementation 2014-02-26 12:03:17 -08:00
lib lib/helpers: added support for null 'ms' metrics. 2014-02-22 22:54:32 -08:00
test tests: improved tests for lib/helpers 2014-02-22 22:54:32 -08:00
utils clearer sample graphite url 2013-02-19 19:02:37 -05:00
.gitignore Be more nodeish... package.json and gitignore 2012-02-15 16:22:24 -05:00
.travis.yml use travis ci to deploy npm packages from tags 2013-12-05 16:40:43 -05:00
CONTRIBUTING.md move contributing information into CONTRIBUTING.md 2014-01-29 14:07:16 +01:00
Changelog.md bump to v0.7.1 2014-02-06 11:36:34 +01:00
LICENSE adding license (mit) 2010-12-29 19:50:11 -05:00
README.md move contributing information into CONTRIBUTING.md 2014-01-29 14:07:16 +01:00
exampleConfig.js Clarify use of backends with example 2014-03-12 09:03:44 -04:00
exampleProxyConfig.js Update to use config library, make cacheSize a config option, and switch to using the health status 2013-04-10 18:54:08 +00:00
package.json bump to v0.7.1 2014-02-06 11:36:34 +01:00
proxy.js Performance tweaks to proxy 2013-12-06 08:56:40 -05:00
run_tests.sh Make failing tests exit with non-zero status 2012-07-20 22:17:08 -07:00
stats.js Enhancement: inject logger object into backend 2013-11-28 18:01:16 +01:00

README.md

StatsD Build Status

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

We (Etsy) blogged about how it works and why we created it.

Inspiration

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

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 integer.

  • 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

More Specific Topics

Debugging

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.

Tests

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 ./run_tests.sh.

Meta

  • IRC channel: #statsd on freenode
  • Mailing list: statsd@librelist.com