Simple daemon for easy stats aggregation
Перейти к файлу
Jason Carver 2d9b0de787 delete stats via management console: move to lib/, docs, generalize, tests 2013-03-22 07:26:58 -07:00
backends Logging is for debug mode 2013-03-02 03:51:27 +00:00
bin add bin/statsd 2012-06-28 16:07:37 +02:00
debian Added status to debian init.d script 2012-12-24 09:14:41 -05:00
docs Update admin_interface.md 2013-03-15 16:35:27 +01:00
examples Adding Scala Example 2013-03-14 10:51:36 -04:00
lib delete stats via management console: move to lib/, docs, generalize, tests 2013-03-22 07:26:58 -07:00
test delete stats via management console: move to lib/, docs, generalize, tests 2013-03-22 07:26:58 -07: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 Testing 0.10 2013-03-12 20:07:46 -03:00
Changelog.md Update Changelog with changes since 0.5.0 2013-03-15 16:49:08 +00:00
LICENSE adding license (mit) 2010-12-29 19:50:11 -05:00
README.md Remove logo ref if we aren't using it yet. 2013-03-18 16:23:44 -03:00
exampleConfig.js Support gathering "top" percentile statistics 2013-03-16 10:58:01 -06:00
package.json Revert temp version bump to keep v0.6.0 support 2013-03-19 11:53:48 -03:00
run_tests.sh Make failing tests exit with non-zero status 2012-07-20 22:17:08 -07:00
stats.js delete stats via management console: move to lib/, docs, generalize, tests 2013-03-22 07:26:58 -07: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 node 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