Variable "Include all option" restrict to only what is listed

  • What Grafana version and what operating system are you using?
    Azure managed Grafana v10.4.7

  • What are you trying to achieve?
    I am creating dashboard with Azure metrics as data source. One of the parameter in my metrics datasource is Country name and this metrics contains data from all over the world. I want to restrict my dashboard to specific countries. I created a dashboard variable and hardcoded the country names I need with “multi select” and “include all option” enabled (Custom variable with comma separated country names).

If I select single country from the dropdown variable, I get the desired data. But if I select “All” in the drop down, graph shows data for every country available in the metrics (way more than what is listed in the variable). I want query to filter to restrict itself to the countries in the variable.

If I inspect the graph (under Json->Panel Data), I see every country and don’t see what parameter was passed to the query when “All” is selected. I tried searching up for options to try under “Custom all value” like “+” etc. I also tried putting hardcoded country list under “Custom all value” but that didn’t help.

Any ideas/clues what is going on here and how I can debug this better. I want to know what exactly is passed to the query when “All” option is selected from the drop down.

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    No errors.

  • Did you follow any online instructions? If so, what is the URL?
    None. I tried the steps per Grafana documentation but that didnt help.

are you using KQL to query things?

It is a version of Kusto.

Some more details from debugging.

I added a Text panel to show content of the variable

CustomCountries = ${CustomCountries}

CustomCountries raw = ${CustomCountries:raw}

CustomCountries value = ${CustomCountries:value}

When I select “All” from the dropdown, I see variable correctly showing comma separated country names. For some reason our backend treats it as load all instead of restricting to list sent as parameter. I am following up with them internally.

To me, this doesn’t look like Grafana issue, but I am still open to hear any ideas and thoughts.

1 Like

Turns out, there is another option I didnt see/try before. If I just use “Multi-value” option and disable “Include All”, I can still select multiple with just one click and it works as expected.

image

1 Like