I'm currently getting into grafana. I've been trying to embed a panel using an iframe in html. Supposedly by adding ?refresh=5s to the link of a panel should make it refresh/update every five seconds. In practice however it seems that within an iframe this doesn't update.
<iframe id="test" src="http://localhost:3000/d-solo/uniqueID/alarms?panelId=2&from=now-3h&refresh=5s" width="900" height="400"/>
The panel/iframe above doesn't auto update. However if I were to click the link it, it then refers me to a page with only that given panel and it does auto refresh/update. Is there anyone who has faced this issue before?
Any help would be greatly appreciated. Thanks in advance.
I believe this is an issue with the url parameters, I noticed this on Grafana 8.5.2 earlier this week when developing, when you attempt to do an export in grafana it looks like this :
<iframe src="http://localhost:3000/d-solo/VCqhZiCnz/your-result-here?orgId=1&from=1654851072856&to=1654872672856&panelId=4" width="450" height="200" frameborder="0"></iframe>
However if you look at the from and to parameters, the time range isn't set properly which means it won't be reacting to any new data coming through, the easiest way to fix this is to replace it with something like this
<iframe src="http://localhost:3000/d-solo/VCqhZiCnz/your-result-here?orgId=1&from=now-24h&to=now&panelId=4" width="450" height="200" frameborder="0"></iframe>
I haven't found a way to set this properly fix/set this in the UI so I'm welcome to suggestions
EDIT : You may need to add a refresh parameter depending on the way your grafana dashboard is setup