Very naively, inspired by the other discussion as well as Present Time Range in Grafana's Text Panel - Stack Overflow, I tried
angular.element('grafana-app').injector().get('timeSrv').refresh = '5s';
While the value was set successfully, it did not have any effect on the actual dashboard behavior.
I suspect that the above is no longer a viable approach in 7.x, with the migration to React? Is there still a reasonable way to achieve what I’m attempting?
@daniellee I figured you might know the answer. Any pointers?
Tough question - I will ask the frontend experts in the team for a better answer as your approach is using Grafana internals that are subject to change in the future.
Did you test using the setAutoRefresh function in the TimeSrv class instead? There is also a
refreshDashboard() function to manually trigger a refresh.
Thanks a lot for letting me know - if it’s not straightforward then I may be able to find another way to achieve what I’m after.
In fact, having an internal timer in the custom JS that periodically triggers
refreshDashboard() may well do the trick here. Will give that a go.
Just to confirm that
is exactly what I was after. Thanks for the tip @daniellee, not sure how I missed that. (and yes…I’m fully aware this may break in the future…)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.