Something like this maybe?:

ifOutOctets + on(ifIndex,hostname,instance,job) group_right (ifName * 0)

On Mon, 15 Mar 2021 at 16:17, Saurabh Jain <[email protected]>
wrote:

> Thanks Harry for the update.
>
> ifOutOctets metric  dont have the label ifName.
>
> However I am getting below response for the same.
>
> [image: image.png]
> pls advice.
>
> On Mon, Mar 15, 2021 at 6:00 PM Harry Perks <[email protected]>
> wrote:
>
>> 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 [email protected] 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 a topic in the
>> Google Groups "Prometheus Developers" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/prometheus-developers/PyK8s75e1vE/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/prometheus-developers/db5825ef-58ba-44f2-b049-ec3050024f9cn%40googlegroups.com
>> <https://groups.google.com/d/msgid/prometheus-developers/db5825ef-58ba-44f2-b049-ec3050024f9cn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-developers/CA%2BTEA9DHhD2%3DKx7%3DnTTzfzepcZQ%2BfXEC06QXywazKYK2oZnzaQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/prometheus-developers/CA%2BTEA9DHhD2%3DKx7%3DnTTzfzepcZQ%2BfXEC06QXywazKYK2oZnzaQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Robert Collier
[email protected]

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-developers/CAO7542LFVnOgfULqQWwyJ9qVJVX%3DzYAtr2b_1OSfVd%2BsKt%3DRXg%40mail.gmail.com.

Reply via email to