Graphite: sum all stats that match a pattern?

≡放荡痞女 提交于 2019-12-09 15:54:12

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/11480952/graphite-sum-all-stats-that-match-a-pattern

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!