Is there a way to list all dashbaords that use a datasource in Grafana?

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?

1 Like

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.

2 Likes

Dear Nayana,

Introduction

On https://weather.hiveeyes.org/, we regularly are facing the same requirements.

As pointed out by @svetb, Grafana itself doesn’t offer such a feature, but we implemented https://github.com/daq-tools/grafana-wtf the other day, which exactly does

Details

We already wrote some more about this at:

We will be happy to hear about whether this was helpful to you. Please let us know if you need further assistance with grafana-wtf.

With kind regards,
Andreas.

2 Likes

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

1 Like

This tool is great and has helped me a lot