How to add two datasources in Grafana template variables ? I want to pull data from two data sources from two different graphite servers using template variables. Current grafana version is 2.5.0
-
I recommend updating your old Grafana - current release is 5.2.5 + use a doc: http://docs.grafana.org/reference/templating/ – Jan Garaj Sep 27 '18 at 19:51
2 Answers
I hope you use the real current Grafana Version, which is 5.3 as of now. When you create a Variable you can select a Datasource, given that you created it beforehand. The Query for the Variable will then go to the specified Datasource. After creating the Variable you can use it in the Dashboard. If you want to use different Datasources for your Panels you can either create two Panels with different Datasources or use the "mixed" option to use different Datasources in one Panel.

- 1
You will have to add additional variables for each datasource, as one variable can only point to one datasource.
let say you have 2 datasources ds_1 & ds_2. So lets create variables node_ds1 & node_ds2
so they may be used in one panel by selecting MIXED datasource and having 2 queries:
node_time_seconds{instance="$node_ds1"}
node_time_seconds{instance="$node_ds2"}

- 63
- 8