Skip to content

Commit

Permalink
[fix] dont rely on state being in the data object and dont block th…
Browse files Browse the repository at this point in the history
…e data from flowing through the stream in the graphite reactor
  • Loading branch information
jcrugzz committed Jul 19, 2013
1 parent 60a5366 commit c561e8d
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions lib/godot/reactor/graphite.js
Expand Up @@ -73,19 +73,17 @@ Graphite.prototype.write = function (data) {
return;
}

metricName = utile.format("%s.%s.%s.%s",
metricName = utile.format("%s.%s.%s",
this.prefix,
data.host.replace(/\./g, '_'),
data.service.replace(/\./g, '_').replace(/\//g, '.'),
data.state
data.service.replace(/\./g, '_').replace(/\//g, '.')
);

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

return err
? self.emit('error', err)
: self.emit('data', data);
if (err) { return self.emit('error', err) }
});

self.emit('data', data);
};

0 comments on commit c561e8d

Please sign in to comment.