-
What Grafana version and what operating system are you using?
Grafana: v9.1.2 (3c13120cde)
OS: Ubuntu 20.04.5 LTS
Datasource: MySQL -
What are you trying to achieve?
To enable a dashboard operator to use a template variable to enter a single, multiple or ALL values when the number of distinct variable items ~2000. -
How are you trying to achieve it?
The template variable contains a list of the distinct values using the following query:
select name from accounts;
The panel includes the variable name within its query as follows:
accounts.name IN (${account:sqlstring}) AND ...
-
What happened?
There are a few problems:
- Because Grafana template variables are limited to just 1000 items, it means that the variable list is always truncated (I actually have about 2000 items that I need to display, but only 1000 are shown)
- Because of point.1, if I choose to select ‘ALL’ for the variable, the query seems to use the truncated list into the mysql query. So the mysql query is always missing the other 1000 items in the query
- If I try to use a custom ‘ALL’ value (%), I can adjust the mysql query to do something like:
accounts.name LIKE "$account" AND ...
And then it works for selecting ALL (and actually gets all including ones that are not in the variable list) but this query does not work if I want to select multiple values from the variable list (an array). - Because of the template variables being limited to just 1000, I’d like to manually type in the values. But it isn’t clear how to type in multiple values that are not listed in the drop down. What is the delimiter between values? (comma/semicolon/space/plus etc dont work)
- What did you expect to happen?
Most of my issues would be solved if Grafana could handle the 2000 variable items. As this is apparently not going to be fixed, it would be helpful if I could find a query that allows me to: a) select individual items, multiple items, and all (that actually queries ALL from DB and not just uses the truncated variable list). Also, it would be nice to know how to manually enter more than one item into the variable input
Many thanks for anyone who takes the time to read and reply