Skip to content
Permalink
Browse files

[api] allow graphite to take an `options.meta` which is a key of a me…

…ta property to insert into graphite (it assumes its a Number) or defaults to `data.metric`
  • Loading branch information...
jcrugzz committed May 25, 2013
1 parent 7b5f78f commit a2af52119e9be5bdd527fb12cd592560587b7143
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/godot/reactor/graphite.js
@@ -42,6 +42,7 @@ var Graphite = module.exports = function Graphite(options) {
this.url = options.url;
this.prefix = options.prefix || 'godot';
this.interval = options.interval || 60000;
this.meta = options.meta || null;
this._last = 0;

this.client = options.client || graphite.createClient(this.url);
@@ -79,7 +80,7 @@ Graphite.prototype.write = function (data) {
data.state
);

metrics[metricName] = data.metric
metrics[metricName] = this.meta ? data.meta[this.meta] : data.metric;
this.client.write(metrics, data.time, function (err) {
self._last = now;

0 comments on commit a2af521

Please sign in to comment.
You can’t perform that action at this time.