Graphite how to summarize based on selected interval

How can I summarize graphite data depending on the selected interval? If the selected interval is up to 1 hour, the data counter should show data points for every minute. If the interval is up to 3 hours, the data should be summarized over 5 minutes. If the interval is up to 1 day, the data should be summarized over 15 minutes.

Is this possible?

2 Answers

You can get something close this this using by creating an interval template variable, enable the Auto option, and set number of steps. In the example below it's set to 40 steps so it will pick an appropriate interval based on the time range.

enter image description here

Use the variable like this: enter image description here

AFAIK Graphite doesn't do this automatically.

However since Graphite has a public API you can script this yourself automatically to retrieve the graph with the correct summarizing period. Grafana for example does this when using the 'auto' option for interval template.

Pseudo-code:

if interval == '1h': get_metric(summarize(metric, '1min', 'sum') elif interval == '3h': get_metric(summarize(metric, '5min', 'sum') elif interval == '1d': get_metric(summarize(metric, '15min', 'sum') 
2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like