Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Aggregate data from different instances

I have a question regarding Graphite, which I'm using with statsD in node.js.

I have a server that I'm, going to run several instances of, and I would like to aggregate statistics like the following among all instances:

  • Mean response time
  • Number of active clients

Right now each instance will get its own folder, as it starts with its own graphs, because the code is:

stats.gauge('requestsPerSecond', reqCounter);

Could I do something like stats('/myServ/aggregates', reqCounter); as well so that each instance will send its data to the same graph in graphite besides keeping track of its own graphs using stats.gauge('requestsPerSecond', reqCounter);?

like image 389
codealot Avatar asked Nov 11 '22 21:11

codealot


1 Answers

I'm not 100% sure what you are trying to do. But in general you can't send the same metric from multiple StatsD instances to the same Graphite server. Graphite only stores the last one arriving in the time window for the highest precision archive. So multiple StatsD instances would overwrite each other. You can however set a server specific prefix (https://github.com/etsy/statsd/blob/master/exampleConfig.js#L67) in the StatsD config that will prepended to the metrics string.

like image 177
mrtazz Avatar answered Dec 08 '22 05:12

mrtazz