statsd / statsd

Daemon for easy but powerful stats aggregation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add a way to see the average of gauges

K900 opened this issue · comments

commented

We have an application reporting the current number of in-flight requests as a gauge, and the value is reported every time a request is added to the queue or removed from it. This generates a lot of data, but statsd only reports the last value it has seen before the flush. What we'd like to see is an average of all values received since the last flush, so that if a spike occurs during an interval, we can spot it on the graphs.

We've worked around this for now by (ab)using timers, but it would be nice to have some sort of an official, non-hacky way to support this use case.

Hey thanks for the suggestion, I'd be open to reviewing a feature proposal or a PR with some implementation. I think this would probably need to be something that's configurable though to make sure people don't get a blast of metrics by doing an update.

On the topic of the suggestion itself, is an average of all gague values going to achieve what you're after? If you're looking for a spike it might be more useful to output a max value (either from the gague or as another new "watermark" metric type).

commented

I feel like the right way to do it would be to support the same aggregations timers have - so average, min, max, percentiles and all that stuff. That way the user gets to choose what they want to see, and statsd gets to reuse all the aggregation logic that's already there for timers, just with a different semantic.

Sounds like a sensible suggestion, I'd be open to looking at a pull request for this. I don't quite have time to do it myself right now but if someone wanted to dive in then crack on and we can talk about it around some code 😄