MySQL query cached?

One of my dashboards had a MySQL that was taking around 20s to execute. This was putting a high load on the DB. I have updated the query, and everything is much better for me, however when I look at my Grafana log, I can still see some requests to this dashboard have a time of around 20,000ms. I think these are clients that are auto-refreshing, but don’t seem to have picked up the new SQL query in the updated dashboard.

I would have expected the clients to load the new dashboard version when they refresh, but they seem to be stuck on the old version. Is this possible?

I have restarted the Grafana container, but there is no change.

Any thoughts on why this might be happening, and how I can resolve this?

Thanks Craig

Yes, the query definition live in the dashboard json that is loaded in the browser , so you need to have people reload the dashboard

Thanks for the response @torkel. It explains what we’re seeing, but raises a couple of additional queries:

(1) Is there any way of blocking these requests? We’re in a large organisation, and it will be hard to track down the client. Nothing I have tried has worked. So far I have:
- restarted the Grafana server
- changed the account password
- reduced the session life time
- deleted and re-created the account
and the requests continue to be accepted. The only thing that temporarily worked was deleting the user account, but as it’s a shared read-only account, I can’t delete it permanently. There doesn’t seem to be any other way to revoke the current session for that user, and force them to re-authenticate, and hence reload the dashboard

(2) does this mean it is possible for the client to execute arbitrary queries on the server?

1 Like

I think this thread answers this question Dashboard variable sql injection