How do multi-value and "All" variables work in PromQL queries?
IntermediateConceptGrafana
Answer
With multi-value enabled, Grafana formats selections as a regex alternation (api|web|worker), so use the regex matcher:
sum by (service) (rate(http_requests_total{service=~"$service"}[$__rate_interval]))
For "All", set a custom all value of .* to avoid sending a huge alternation of every value. Using = instead of =~ with a multi-value variable is a classic bug that returns no data.
More on Grafana
What is Grafana and what is it not?BeginnerWhat is a Grafana datasource and how do you provision one?BeginnerWhat are dashboard variables and what types exist?IntermediateWhat are Grafana's built-in time variables?IntermediateWhat does "dashboards as code" mean and what are the options?IntermediateHow do you provision dashboards from files?Beginner