Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I change the datasource for a Grafana dashboard?

Tags:

grafana

I've got a new datasource I would like an existing dashboard to use.

How can I change it over? Is there a quicker way than exporting / importing the dashboard?

like image 937
Chris Stryczynski Avatar asked Feb 19 '19 23:02

Chris Stryczynski


People also ask

How do I change my dashboard source?

To change your dashboard's data source:Hover over Change Data Source and select the new data source. The source is added to your list. You now add new widgets from any of your data sources to the dashboard.

How do I add datasource to Grafana dashboard?

Add a data sourceMove your cursor to the cog icon on the side menu which will show the configuration options. Click on Data sources. The data sources page opens showing a list of previously configured data sources for the Grafana instance. Click Add data source to see a list of all supported data sources.

Can Grafana have multiple data sources?

Amazon Managed Grafana supports many different data sources. Data sources are storage backends that you can query in Grafana to do things like building dashboards. Each data source has a specific query editor that is customized for the features and capabilities that the particular data source exposes.

How do I check my Grafana data source?

After you have enabled permissions for a data source you can assign query permissions to users and teams which will allow access to query the data source. Assign query permission to users and teams: Navigate to Configuration > Data Sources. Select the data source you want to assign query permissions for.


2 Answers

Specifying a variable would not solve all the problems with changing a data source for the existing dashboard - there will be still some metadata pointing to the old one, which will result in failures. The only thing that worked for me was to go to dashboard setting and copy aside the JSON model, careful find+replace and pasting back the model. I know it's pretty lame, but this was the only thing that worked. There seems to be something missing with this feature in Grafana at the moment...

like image 124
michalrudko Avatar answered Sep 28 '22 11:09

michalrudko


You can specify data source variable for a dashboard:

http://docs.grafana.org/reference/templating/#variable-types

like image 30
sumek Avatar answered Sep 28 '22 11:09

sumek