GameChanger Metrics API. This node module provides an API for logging application metrics to the infrastructure's monitoring platform.
-
Include gcmetrics.js in your app project by adding a line to your package.json file:
... "dependencies": { "gcmetrics": "git+ssh://git@github.com:gamechanger/gcmetrics.js.git" } ... -
Run
npm installto install the package into your app'snode_modules. -
Within your app, require
gcmetricsand use this object to log metrics:var metrics = require('gcmetrics'); metrics.registerDogStatsD(host, port); // run this once, before emitting any metrics metrics.increment('requests');
-
That's it.
- Each key logged to the metrics API is automatically prefixed with the enclosing application's name, as declared in the application's
package.jsonfile. For example, if I callmetrics.increment('requests')within the "push" application, the actual key logged to DataDog will bepush.requests.
- Push/Pop tag context
- Chained API, e.g.
metrics.timed('response').tag('http_code', 404).exec(cb);
To install gcmetrics dependencies run npm install.
To run test run make test.