A node.js client for Librato Metrics (


librato-node is a Node.js client for Librato Metrics (

$ npm install librato-node

Once librato.start is called, a worker will send aggregated stats to librato once every 60 seconds.

var librato = require('librato-node');
librato.configure({email: '', token: 'ABC123'});
process.once('SIGINT', function() {
  librato.stop(); // stop optionally takes a callback 

Use librato.increment to track counts in librato. On each flush, the incremented total for that period will be sent.

var librato = require('librato-node');

Use librato.timing to track durations in librato. On each flush, the library sends a count, sum, min, max, and sum_squares metric for that period so librato can accurately display multi-sample measurements.

var librato = require('librato-node');
librato.timing('foo', 500);

librato-node includes Express middleware to log the request count and response times for your app. It also works in other Connect-based apps.

var express = require('express');
var librato = require('librato-node');
var app = express();

The key names the middleware uses are configurable by passing an options hash.

librato.middleware({requestCountKey: 'myRequestCount', responseTimeKey: 'myResponseTime'});

$ git clone && cd librato-node
$ npm install
$ npm test

librato-node is largely based off of Librato's own librato-rails. Visit that repository if you're running Ruby or for more information on Librato Metrics in general.