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.

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Grafana