Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to see the average of gauges #687

Open
K900 opened this issue Nov 20, 2019 · 3 comments
Open

Add a way to see the average of gauges #687

K900 opened this issue Nov 20, 2019 · 3 comments
Labels
feature A new feature, or a feature request

Comments

@K900
Copy link

K900 commented Nov 20, 2019

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.

@BlueHatbRit BlueHatbRit added the feature A new feature, or a feature request label Nov 20, 2019
@BlueHatbRit
Copy link
Member

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).

@K900
Copy link
Author

K900 commented Nov 20, 2019

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.

@BlueHatbRit
Copy link
Member

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 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature, or a feature request
Projects
None yet
Development

No branches or pull requests

2 participants