Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Graphite: sum all stats that match a pattern?

I'm sending stats to a Graphite server via statsd. My stats are fairly fine-grained, and can be easily added by developers. I'd like to roll up all statistics matching a certain pattern (stats.timers.api.*.200.count, for example). Is that possible within Graphite?

If not, are there other systems that I should be looking at that can generate that type of roll-up data from statsd? Or is this the sort of thing that I should do within my statsd configuration directly?

like image 743
Patrick Linskey Avatar asked Jul 14 '12 04:07

Patrick Linskey


1 Answers

If you after a blanket sum of all the data that matches, then you can use 1 sumSeries.

an example:

  sumSeries(stats.timers.api.*.200.count)

would give you the total for everything that matches stats.timers.api.*.200.count

You can group metrics together via the 2 groupByNode.

an example

  groupByNode(stats.timers.api.*.*.count,4,"sumSeries")

would give you a a sum of all the timers that match stats.timers.api.*, by the 4th column ( in this case return code? )

All the functions are documented at http://graphite.readthedocs.org/en/1.0/functions.html

like image 134
dannyla Avatar answered Nov 08 '22 11:11

dannyla