-
What Grafana version and what operating system are you using?
-
What are you trying to achieve?
I’d like to change the queries in the panels, dynamically based on given variable (user input).
- How are you trying to achieve it?
I have defined a single “custom” Variable called “app”. My “Custom Options” is like: “foo : bar, bar : baz, baz : qux” with “Label and value” type.
So that I can use that label:
avg(avg_over_time(my_custom_metric_exposed_by_foo{job="${app}"}[$__rate_interval])) * 100
But I’d like to change the metric based on given label. Imagine my_custom_metric_exposed_by_foo
is not exposed by bar
and baz
.
For example, if I choose the bar
, i’d like to adjust to query to use my_custom_metric_exposed_by_bar
.
- What happened?
How can I do that?
-
What did you expect to happen?
-
Can you copy/paste the configuration(s) that you are having problems with?
-
Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
-
Did you follow any online instructions? If so, what is the URL?
Yes, but no luck. Its outdated and for SQL queries: