Does ifOutOctets have a label ifName? If not, you'll need to perform a 
vector match operation - it looks like ifIndex can be used:

sum by(ifName) (ifOutOctets * on(ifIndex) group_left(ifName) ifName)

On Monday, March 15, 2021 at 11:38:41 AM UTC s.saurab...@gmail.com wrote:

>
> Hello,
>
> I have a certain requirement to implement in Grafana where we need to show 
> interface utilization for switch.
>
> I got combination of two queries in order to achieve it
>
> 1) ifOutOctets{hostname="XX",ifIndex="103",instance="XX",job="SNMP"} 
>
> 2) 
> ifName{hostname="XX",ifIndex="103",ifName="Te1/0/1",instance="XX",job="SNMP"}
>
> First query -- It gives interface utilization on specific index
>
> Second query --- It gives interface name mapped to specific index
>
> Now How can I combine both these query in a way that I get interface 
> utilization on interface name not on index.
>
> Pls advice.
>
> Thanks,
> Saurabh

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prometheus-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-developers/db5825ef-58ba-44f2-b049-ec3050024f9cn%40googlegroups.com.

Reply via email to