Refresh dashboard every "n"th minute

Hello everyone,

Is there a way to refresh the dashboard every "n"th minute like in cron job?

Now the dashboard refreshes itself after every n minute it’s been loaded in the browser.

Thanks in advance.

Is there a way to refresh the dashboard every "n"th minute like in cron
job?

Not that I know of, but why do you want it to?

Now the dashboard refreshes itself after every n minute it’s been loaded in
the browser.

What’s the difference? If you’re viewing the dashboard in a browser, it
refreshes every N minutes. If you’re not viewing it in a browser, why do you
care that it isn’t refreshed?

Bear in mind that there isn’t such a thing as “the dashboard”. There’s a
definition of all the panels which make up a dashboard, and if a browser
requests those panels, it gets the current versions (which then refresh as
long as the browser remains connected), but if another browser connects and
requests the same dashboard, they each refresh independently.

It’s the view in the browser which is getting refreshed, not some notional
“dashboard” which any browser that connects then sees, and all browsers get
the same view.

The closest I can think of to achieve what you’re asking for is to run a
browser on some machine (maybe the same machine as Grafana is on) and then use
a remote screen view (so, VNC or similar) to see that single browser window
from any other machine/s you want to view it on.

Antony.

Hi Antony,

Thanks a lot for the answer.

Not that I know of, but why do you want it to?

Let me try to explain why I thought this feature would be useful. We are submitting the data every 5th minutes (cron job) to the database.

So, let’s assume that our last data points would be at 12:10 and user opens the dashboard at 12:14, then user will get the last data points which was at 12:10.
After this, panels will be refreshed at 12:19 (our Auto-refresh interval is 5 min), and it means that user could think that it took 9 minutes to get the new datas.

Of course, we could lower the Auto-refresh interval, but it would be costly if we have hundreds of users.

PS.English is not my native language. So if something is not clear, please accept my apology :wink:
PPS. We are showing last data point time and actual time on a seperate panels. This is the reason that we need "n"th minute auto-refresh.

We are submitting the data every 5th minutes (cron job) to the database.

Okay.

So, let’s assume that our last data points would be at 12:10 and user opens
the dashboard at 12:14, then user will get the last data points which was
at 12:10. After this, panels will be refreshed at 12:19 (our Auto-refresh
interval is 5 min), and it means that user could think that it took 9
minutes to get the new datas.

Your English is excellent, but your arithmetic is not quite right…

If you submit data points at 12:10 and the user opens the dashboard at 12:14
they will see the latest data available, from 12:10 - 4 minutes old.

The data then updates at 12:15 but the user sees nothing until 12:19, when the
browser refreshes, however they still see data which is 4 minutes old (and is
the latest available), not 9 minutes old.

I don’t believe that there is any way to get Grafana to refresh the browser’s
view of the database shortly after the data has been updated by the cron job,
since this is a request action from the browser, not a push action from
Grafana.

(If I’ve misunderstood how the browser-server refresh process works, please
someone step in and correct me.)

I have one suggestion which might be a suitable workaround for you: create a
panel in your dashboard which shows the age of the data being displayed; the
users can then see how old the information they are looking at is. It’ll
never be more than 5 minutes (working from the timings you’ve given), but if
it’s important to them to know whether the data is 30 seconds old or 4 minutes
and 30 seconds old, this will tell them.

I do this (in a pretty old version of Grafana, hopefully it still works for
you in current versions) using:

  • singlestat panel
  • format = dateTimeFromNow
  • query = “select last(somedataitem) from …”
  • resultFormat = time_series
  • value_name = last_time

That tells me, every time the panel refreshes (which is fixed to the same as
the rest of the dashboard) how old the data is.

Good luck :slight_smile:

Antony.

Thanks a lot for your suggestions. :smiley: