Query variable not dynamically fetching options

Hi Grafana team!

I stumbled upon an issue. I am using Query variable in dashboard, which should dynamically fetch possible values from datasource. The problem is - it only fetches these values once when defining it in dashboard variable settings. Once created, it does not fetch new values anymore (it does not send any queries to datasource).

I expected same behavior as in adhoc filters, where every chosen option queries the datasource tag-values.

It is quite a big problem when exporting and reusing dashboards. Let’s say I have multiple clients. Every client has different list of servers. I want to include Query variables “server” which fetches this list from the datasource backend. Problem is, it does not (or does, once, when creating the variable). When I export the dashboard, it exports this variable with all possible options already fetched from the original grafana installation.

I think this is a bug in grafana rather than my misunderstanding of the Query variable. It says in the documentation: “The variable values change as they dynamically fetch options with a data source query.”

Edit: Nevermind, I just can’t read … for anyone having the same problem, you have to set the Refresh option in the variable configuration.

1 Like