How Does Grafana Refresh Data on Dashboard Reload?

Hello Grafana Community,

I couldn’t find any documentation explaining the mechanism behind how Grafana refreshes data on dashboard reload, so I’d like to ask a question here.

Let’s say I am using the Infinite data source and running a query with from: now-1h, to: now. If I set the refresh interval to 1 minute, does Grafana:

  1. Shift the time range forward by 1 minute and fetch only the new 1-minute data?
  2. Or does it run the query again with from: now-1h, to: now using the current timestamp at the time of refresh?

I’d appreciate any insights on how Grafana handles this.

Have a great day!

  • What Grafana version and what operating system are you using?
    I’m Using v10.2.0 Enterprise Edition on Linux

  • What are you trying to achieve?
    Find mechanism of refreshing dashboard on Grafana

  • How are you trying to achieve it?

  • What happened?

  • What did you expect to happen?

  • Can you copy/paste the configuration(s) that you are having problems with?

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

  • Did you follow any online instructions? If so, what is the URL?

2 Likes

I recommend to use browser console and you will see. I guess it is 2.)

Grafana has special $__from and $__to variables that at all times hold the values specified in the time picker.

To be precise about your question – Infinity doesn’t adjust anything in response to the time picker unless you use the variables. So for example, if the way you build the URL that infinity is fetching includes these variables above, then whenever you adjust the time picker, the URL infinity needs to load changes, and hence it will trigger a refresh.

If you just load some standard URL with no variable reference, and then you change the time picker, nothing will refresh because what you’ve told Infinity to load doesn’t in any way depend on the time picker.

Hope this helps

See this answer for a concrete example in SQL context:

Grafana runs the query again with from: now-1h, to: now using the current timestamp at each refresh. It does not fetch only the new 1-minute data but instead reevaluates the entire time range based on the latest “now” value. This ensures the dashboard always reflects the most up-to-date data.