This is a pluggable backend for StatsD, which publishes stats to Librato Metrics.
- StatsD versions >= 0.3.0.
- An active Librato Metrics account.
$ cd /path/to/statsd
$ npm install statsd-librato-backend
You have to add the following basic configuration information to your StatsD config file.
{
librato: {
email: "myemail@example.com",
token: "ca98e2bc23b1bfd0cbe9041e824f610491129bb952d52ca4ac22cf3eab5a1c32",
}
}
Add the statsd-librato-backend
backend to the list of StatsD
backends in the StatsD configuration file:
{
backends: ["statsd-librato-backend"]
}
Start/restart the statsd daemon and your StatsD metrics should now be pushed to your Librato Metrics account.
The Librato backend also supports the following optional configuration
options under the top-level librato
hash:
-
source
: An optional source name to use for all measurements. If a metric name contains source value(s) (metric name formatted as: 'metric_name/source1/source2'), the metric specific name will take precedence over this value. -
snapTime
: Measurement timestamps are snapped to this interval (specified in seconds). This makes it easier to align measurements sent from multiple statsd instances on a single graph. Default is to use the flush interval time. -
countersAsGauges
: A boolean that controls whether StatsD counters are sent as native Librato Metrics counters (default) or as Librato Metrics gauges. The original Librato statsd fork sent StatsD counters as gauges instead of counters, so this provides an easy upgrade path. Defaults to false. -
skipInternalMetrics
: Boolean of whether to skip publishing of internal statsd metrics. This includes all metrics beginning with 'statsd.' and the metric numStats. Default false -- they are published to Librato.
If you are upgrading from the old Librato statsd fork, then the minimal upgrade steps are:
- Upgrade to the latest Etsy statsd.
- In the statsd directory, install the Librato backend:
npm install statsd-librato-backend
. - Swap the statsd configuration variable
graphService
with thebackends
list. So if your old configuration looked like:
{
graphService: "librato-metrics",
libratoUser: "myemail@example.com",
libratoApiKey: "ca98e2bc23b1bfd0cbe9041e824f610491129bb952d52ca4ac22cf3eab5a1c32",
...
}
Then your new configuration would look like:
{
backends: ["statsd-librato-backend"],
libratoUser: "myemail@example.com",
libratoApiKey: "ca98e2bc23b1bfd0cbe9041e824f610491129bb952d52ca4ac22cf3eab5a1c32",
...
}
The Librato backend will automatically detect a legacy configuration
file and set countersAsGauges
to true to maintain backwards
compatibility.
If you would like to upgrade to native Librato Metrics counters, then you'll need to:
- Stop all statsd daemons.
- Switch to the new configuration format listed at the top of this
file, ensuring that
countersAsGauges
is false or not set. - Using the UX or API, delete all statsd counters that were originally published as gauges to Librato Metrics.
- Restart all statsd daemons.
You can push metrics to Graphite and Librato Metrics simultaneously as
you evaluate Librato. Just include both backends in the backends
variable:
{
backends: [ "./backends/graphite", "statsd-librato-backend" ],
...
}
See the statsd manpage for more information.
None
If you want to contribute:
- Clone your fork
- Hack away
- If you are adding new functionality, document it in the README
- Push the branch up to GitHub
- Send a pull request