Auto Refresh Caching

Hi we are using Grafana Cloud and querying InfluxDB as a data source. Recently, we have been getting throttling errors related to exceeding the total query time, as set by the Global limits of Influx.

We have auto-refresh in a lot of dashboards, which increases the query fequency and time. However, I am curious to know how the auto-refresh is handled within Grafana Cloud.

For example, if the time interval at the top right is set to past 3 hours, and the auto refresh is set to every 10s, is Grafana querying the past 3 hours every single refresh?? Or is it simply querying for the last 10s, then combining with the cached data of the past 3 hours?

It looks like there is some data source caching: Data source management | Grafana documentation

But its not clear exactly how this works for auto-refresh, and if it actually only queries Influx for the delta, rather than the whole 3 hours

Grafana caching is based on selected timeframe. So panel will get cached result if some other panel made the same query with the same timerange.

So caching won’t help you if you use “last 3 hours” timerange (because this time range is differenent every second), but it will help if you select “current day” time range .

I see, so caching only works for “static” time ranges?

Is there any way to make Grafana only query for the delta? i.e. if the time range is 3hours, and auto refresh is 5s, theres no need to constantly query for the whole 3 hours every refresh. Only the last 5-10s needs to be queried

1 Like

Search doc/commits for this feature(please don’t aske me if it’s available for influx):

Hello,
I think when you set the auto-refresh to every 10 seconds and the time interval to the past 3 hours, Grafana will re-query the entire past 3 hours every 10 seconds. It doesn’t just query the last 10 seconds and combine it with cached data. This can significantly increase the load on your InfluxDB, leading to throttling errors.