I’m trying to use templates to select a datasource, based on a different template variable.
I have several Sensu servers deployed to different environments. Grafana can talk to each of these and has them configured as datasources (example: Sensu-Dev, Sensu-QA, Sensu-Prod). I have a template for accessing Graphite data from the different environments (Dev, QA, Prod).
I want my dashboard to be able to present data from both, but I want them to stay in sync without needing to set each template value individually. Basically, I want to have a $environment variable, and have that update a hidden template value for the Sensu datasource. If $environment is set to Prod, then the Sensu datasource becomes Sensu-Prod.
I have tried to set this up using a datasource template, with Sensu as my datasource type, and using the $environment variable in the filter in various ways, but it is not working out.
Hello torkel, thanks for your response so far. I wanted to get clarity of this feature to understand if it is something that I am looking for.
Similar to kilteer, I have a Sensu use case. I have two template variables, $server, $application. I would like the value selected in the first list of $server to refresh / update a list of applications in the second list - $application
Can not figure out how to do that. Have a variable (called env) of Type: Custom and want that selected value of this is used to prefix another variable of type: Datasource / Cloudwatch. Tried to write a regular expression in the instance name filter but doesn’t seem to work. Only getting “No datasource found”. Please can anyone point me in the right direction? Thanks
Hi, I cannot figure out how to use it.
I have multiple Prometheus instances and I have a Custom multi-value variable called PrometheusInstance with choices A,B,C.
I would like the datasource to change based on the value of the variable and my 19 panels to display the metrics from the corresponding instance of Prometheus.
How to achieve this? Using $PrometheusInstance in the datasource url or name did not work.