- What Grafana version and what operating system are you using?
8.3 on Linux
- What are you trying to achieve?
I have a Bar Gauge panel that repeats based on a Dashboard array Variable. I want the gauge to use the current value of the variable in the query, and use the returned value for the gauge.
- How are you trying to achieve it?
I created a dashboard variable that returns an array containing each instance of a Redis key (i.e. $my_var = [0,1,2,3] if there are 4 instances of the key). My Redis database will contain a variable number of branches based on the number if installed sensors, and each branch will contain a key with the value I want to use.
I created a Bar Gauge panel that’s set to repeat based on that variable. So in the case above, it will repeat 4 times. I put $my_var in the panel title, and the title is correct for each repeated panel (Sensor 0, Sensor 1, …).
I created a Redis GET query to retrieve the value from a Redis key. The variable is used in the key name (GET api:$my_var:voltage). I also have two more queries that retrieve the MIN and MAX values, but those queries don’t use the variable.
In the “Value Options” section, in the “Fields” drop-down, I’m choosing my query as the field to display. However, in the drop-down, it displays as “api:0:voltage” instead of “api:$my_var:voltage”.
- What happened?
Only the first panel in the repeating series works properly, the rest show “No data”. It seems as if every repeated panel is trying to use the results from a query “api:0:voltage” instead of “api:$my_var:voltage”.
- What did you expect to happen?
I expect each panel to query the value from the correct Redis key and use that value in the Gauge. i.e. On the second panel, which has the title “Sensor 1”, I expect it to retrieve the value from “api:1:voltage” and display that value in the gauge.