We are making changes to some of our datasources and are looking for a way to find all dashboards using these datasources. Is there a way to list all dashbaords using a datasource?
I don’t think there’s an “off-the-shelf” way. You’d probably need to iterate through each of the dashboard definitions and check whether any panels (or template variables) use that datasource. To do that you could either:
a) Write a script that pulls each dashboard’s JSON definition via the API and does a text search for the datasource name. (probably the “right” way to do this, but requires some effort)
b) Run a SQL query to search the Grafana database. You’d need to search through the
data column of the
dashboard table. (probably the quicker way, provided you have direct access to the DB)
If you’re using the (default) SQLite Grafana database, you could also open up grafana.db in a visual explorer (like https://sqlitebrowser.org) and quickly filter the dashboard definitions with that.
On https://weather.hiveeyes.org/, we regularly are facing the same requirements.
We already wrote some more about this at:
- Use "grafana-wtf" to search through all entities of a Grafana instance
- How can I search for a dashboard by content (e.g. name of panel, used metric, used function)
We will be happy to hear about whether this was helpful to you. Please let us know if you need further assistance with
With kind regards,
This looks useful, we will give this a try and see how it works for us. WIll get back here to let you know how it went, Thanks
This tool is great and has helped me a lot