Templating for datasource for dashboards queries row repeat/panel repeat

Hello,

I’m trying to create a dashboard that displays data from multiple influxdb datasources (multiple databases on the same influx instance). I can create a variable that returns all the databases via show databases.
Now I’d like to do a row repeat per datasource and thus set the datasource for every query based on this template. But the ‘Panel Datasource’ setting on a panel can not take variable names.

Is this something that can be done? I think it would make a lot of sense.

Cheers,
R.

1 Like

Panel Data source supports Date source template variables. So you need create a seperate data source for each InfluxDB database

Thanks I found that out on a different thread, I missed the type of template ‘datasource’. So this looked like it would work. But I think there is an option missing: you can’t specify ‘multi-select’ or ‘all’ option on a datasource template variable, so you can’t create a panel or row repeat on $datasource as the variable is always one value :frowning:

Maybe a bug? Or is there a limitation?

No its done on purpose, repeating on datasource variable is not supported, like won’t either

Any specific reason for that?

My usecase is that I have multiple organisations (tenants) that I’d like to keep separated. Now I want to create an overview dashboard in an organisation that has configured all datasources of these tenants and display some data (high level summaries) of all tenants.
In that case repeating on a datasource would make sense.

In influxdb you can query any database no matter how you configured your datasource. So you could define a normal variable and use that in your query.
SELECT * FROM database.default.table
default is the retention policy if you use a variable in place of database you can select from a different database if its on the same influxdb instance

@svenklemm, that my friend was the simplest and most obvious solution! Thank you! Feeling stupid now that I didn’t think about that! You are my hero!