Search code examples
grafanapromql

In Grafana how do you get multi lines from multi-select variable and a single query


I have a simple query and 2 variables, one of them is multi-select. What I'd like to do is get 1 line per multi-select.

{__name__ ="fusion:$METRIC:$POD"}

METRIC is a multi select and POD is a single select. So, I'd like to show, say, 4 metrics for the same pod.

How do I achieve this?


Solution

  • Whenever you have multi-select value in Grafana, use regex selector =~.

    For PromQL queries Grafana will automatically substitute your variable with value like (val1|val2|val3).

    So your query in this case would be

    {__name__ =~"fusion:$METRIC:$POD"}