Simple daemon for easy stats aggregation
Перейти к файлу
Frederic Jaeckel a7e955bf1b remove ${misc:Depends}, it's unnecessary
- this only got added because of a lintian error/warning which isn't thrown
  anymore (4584ba61d9)
2013-08-20 14:45:27 +02:00
backends Merge branch 'master' into optional_counts 2013-08-02 12:06:13 -04:00
bin add bin/statsd 2012-06-28 16:07:37 +02:00
debian remove ${misc:Depends}, it's unnecessary 2013-08-20 14:45:27 +02:00
docs Update graphite.md 2013-08-14 13:39:15 +02:00
examples Correct obvious mistakes causing build to fail. 2013-08-08 17:36:12 +01:00
lib add more tests for metric types 2013-08-09 22:08:28 +02:00
test add more tests for metric types 2013-08-09 22:08:28 +02: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 Remove v0.6 from node versions we test against 2013-07-03 16:38:14 -04:00
Changelog.md typo 2013-03-31 20:48:30 +02:00
LICENSE adding license (mit) 2010-12-29 19:50:11 -05:00
README.md Set the process title to 'statsd' 2013-05-20 11:33:40 +01:00
exampleConfig.js Merge pull request #311 from etsy/process_mgmt 2013-08-02 11:39:30 -07:00
package.json Drop v0.6 support 2013-07-03 16:37:31 -04:00
run_tests.sh Make failing tests exit with non-zero status 2012-07-20 22:17:08 -07:00
stats.js extract packet parsing into helper module 2013-08-09 21:33:25 +02: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

Contribute

You're interested in contributing to StatsD? AWESOME. Here are the basic steps:

fork StatsD from here: http://github.com/etsy/statsd

  1. Clone your fork
  2. Hack away
  3. If you are adding new functionality, document it in the README
  4. If necessary, rebase your commits into logical chunks, without errors
  5. Verfiy your code by running the test suite, and adding additional tests if able.
  6. Push the branch up to GitHub
  7. Send a pull request to the etsy/statsd project.

We'll do our best to get your changes in!

Contributors

In lieu of a list of contributors, check out the commit history for the project: https://github.com/etsy/statsd/graphs/contributors