Multiple nested repeated variables

Hi There

I’m using Prometheus’ snmp_exporter to get metrics of my switches. I want to graph different interface metrics and rely on the ifIndex for graphing.

$Device  query_result(sum by (instance)(ifDescr{job="snmp"}))
$Index   query_result(sum by (ifIndex)(ifDescr{job="snmp",instance="$Device"}))

I use repeating rows and repeat $Index.

$Index is not easily recognisable hence I want to also make use of the ifDescr and ifAlias

$Interface    query_result(sum by (ifIndex) (ifDescr{job="snmp",instance="$Device",ifIndex="$Index"}))
$Alias        query_result(sum by (ifAlias) (ifAlias{job="snmp",instance="$Device",ifIndex="$Index"}))

I have include All checked for $Index to get all interfaces but then $Interface and $Alias are None.

Only if I select a specific $Index, $Interface and $Alias get propagated.

How can I overcome this behaviour to display $Interface and $Alias?

Many Thanks,

Since Prometheus data source uses regex format for All value (All=[1,2,3] will be transformed to 1|2|3) you should use ifIndex~="$Index". And you can simply set custom All value to .* regex.

Many thanks for the suggestion. I have tried the suggested fix but it simply displays the string All now and does not update at all. Even if i select a single interface index it just display all.

Hi, did you find any solution for this? I am trying to figure out with same problem in my env.