Simple daemon for easy stats aggregation
Перейти к файлу
Marc Fournier 297b9074d2 debian: avoid running service as root/nobody
Create a new _statsd system user on package installation (and remove him
when package is purged), and modify upstrart and init-script to have
this user run the daemon.
2013-05-14 21:13:06 +02:00
backends Remove statsCached from console backend 2013-04-10 23:48:22 -04:00
bin add bin/statsd 2012-06-28 16:07:37 +02:00
debian debian: avoid running service as root/nobody 2013-05-14 21:13:06 +02:00
docs Add link to statsd-http-backend 2013-04-16 13:30:39 -04:00
examples Adding Scala Example 2013-03-14 10:51:36 -04:00
lib cleanup whitespace and small tweaks 2013-04-30 14:53:55 +00:00
test Merge pull request #200 from zwily/upper_percentiles 2013-03-23 14:54:46 -07:00
utils clearer sample graphite url 2013-02-19 19:02:37 -05:00
.gitignore Revert "Add local config to git ignore" 2013-04-11 11:51:58 -04:00
.travis.yml Don't need to test on .9 now that .10 is out. 2013-04-08 13:24:10 -03: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 Remove logo ref if we aren't using it yet. 2013-03-18 16:23:44 -03:00
exampleConfig.js Add health status functionality 2013-03-28 13:41:06 -04: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 Merge pull request #246 from carver/delete-group 2013-04-11 14:46:43 -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