Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to add a scripted dashboard to the Home "Dashboards" list?

I've created a scripted dashboard for Grafana v2.1.2 and would like to add it to the Home dashboard list, however don't see a way to do it using the GUI's dashboard settings.

Is it possible? And if so, is there some documentation or example on how to do this?

like image 957
Alan Avatar asked Sep 27 '22 22:09

Alan


1 Answers

This seems to be an longstanding issue with grafana and is not supported as mentioned on https://github.com/grafana/grafana/issues/4145

But luckily there is a workaround as described on https://github.com/anryko/grafana-influx-dashboard/issues/54

You will have to create a new grafana dashboard. In dashboard settings you should rename it to "Scripted Dashboard". Then add a "text" row of "html" type. Then to the text field of that row you need paste this code:

<meta http-equiv="refresh" content="1;url=/dashboard/script/getdash.js">
<script type="text/javascript">window.location.href = "/dashboard/script/getdash.js"</script>

After this is done you will have to save the dashboard. That's it. Now from your Grafana Home screen you can select newly created "Scripted Dashboard" and it will automatically redirect you to the actual GetDash dashboard.

In Grafana 4, you add a text panel in a row and switch mode from Markup to HTML, then insert snippet above.

Downside of this solution is that such dashboards can't be used in playlists (will redirect out of playlist's url).

Be careful about URL (especially if you run grafana under /grafana path) as this redirect dashboard can not be deleted from web UI, you will need to use API for that or (as stated in above issue)

Create a new one with the same name. Then on saving action it will let you overwrite the old one.

Update: Grafana 6 does not allow workaround anymore :(

like image 87
VasekCh Avatar answered Oct 13 '22 01:10

VasekCh