Search code examples
graphitestatsd

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?


Solution

  • 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