Posted on October 22, 2021 2:16 pm
 |  Asked by Clément DE FARIA
 |  30 views
RESOLVED
0
0
Print Friendly, PDF & Email

Hi Everyone

We’re trying to graph differents metrics with prometheus and grafana.

We intalled ocprometheus on the switches etc…

No issues on the basic steps.

But we’re going to perform some tests with pfc and it would be great to get the counter intfPfcClassCounter it gives a per interface count of pfc frames but mostly it seems to be per class too.

here’s an example of output via rest :


[user@device ~]$ curl localhost:6060/rest/Smash/counters/ethIntf/StrataCounters/current
{
"counter": {
"Ethernet1/1": {
"counterRefreshTime": 0,
"ethStatistics": {
"alignmentErrors": 0,
"carrierSenseErrors": 0,
"deferredTransmissions": 0,
"excessiveCollisions": 0,
"fcsErrors": 0,
"fragments": 0,
"frameTooLongs": 0,
"frameTooShorts": 0,
"in1024To1522OctetFrames": 18000,
"in128To255OctetFrames": 36000,
"in1523ToMaxOctetFrames": {
"value": 1184701536
},
"in256To511OctetFrames": 18866,
"in512To1023OctetFrames": 18000,
"in64OctetFrames": 541240,
"in65To127OctetFrames": 984134549,
"inPauseFrames": 0,
"inPfcClassFrames": {
"count": [
{
"value": 0
},
{
"value": 0
},
{
"value": 0
},
{
"value": 540412
},
{
"value": 0
},
{
"value": 0
},
{
"value": 540412
},
{
"value": 0
}
]
},
"inPfcFrames": {
"value": 540412
},
"inPfcRatePerMcQ": {
"rate": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
},
"inPfcRatePerQ": {
"rate": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
},
"inUnknownOpcodes": 0,
"internalMacReceiveErrors": 0,
"internalMacTransmitErrors": 0,
"jabbers": 0,
"lateCollisions": 0,
"multipleCollisionFrames": 0,
"out1024To1522OctetFrames": {
"value": 47000
},
"out128To255OctetFrames": {
"value": 364815
},
"out1523ToMaxOctetFrames": {
"value": 4953871548
},
"out256To511OctetFrames": {
"value": 48260
},
"out512To1023OctetFrames": {
"value": 47000
},
"out64OctetFrames": {
"value": 916
},
"out65To127OctetFrames": {
"value": 692005935
},
"outPauseFrames": 0,
"outPfcClassFrames": {
"count": [
{
"value": 0
},
{
"value": 0
},
{
"value": 0
},
{
"value": 0
},
{
"value": 0
},
{
"value": 0
},
{
"value": 0
},
{
"value": 0
}
]
},
"outPfcFrames": {
"value": 0
},
"outPfcRatePerPrio": {
"count": [
{
"value": 0
},
{
"value": 0
},
{
"value": 0
},
{
"value": 0
},
{
"value": 0
},
{
"value": 0
},
{
"value": 0
},
{
"value": 0
}
]
},
"singleCollisionFrames": 0,
"sqeTestErrors": 0,
"symbolErrors": 0
},
"genId": 0,
"key": "Ethernet1/1",
"linkStatusChanges": 0,
"rates": {
"inBitsRate": {
"value": 0.10381805255265979
},
"inPktsRate": {
"value": 0.0001966250995315522
},
"outBitsRate": {
"value": 552.5701967185665
},
"outPktsRate": {
"value": 0.5334745493749802
},
"statsUpdateTime": 1634911528.018835
},
"statistics": {
"inBroadcastPkts": 25,
"inDiscards": 0,
"inErrors": 0,
"inMulticastPkts": 151,
"inOctets": 4995633514244,
"inTotalPkts": 2169468191,
"inUcastPkts": 2168927603,
"lastUpdate": 1634911528.018835,
"outBroadcastPkts": 53,
"outDiscards": {
"value": 0
},
"outErrors": 0,
"outMulticastPkts": 4332094,
"outOctets": {
"value": 20655583574827
},
"outUcastPkts": 5642053327
}
},

I used the path found here https://github.com/aristanetworks/goarista/blob/master/cmd/ocprometheus/sample_configs/ocprometheus-7050.yml


- name: intfPfcClassCounter
path: /Smash/counters/ethIntf/StrataCounters/current/(counter)/(?P.+)/ethStatistics/(?P(?:in|out))(PfcClassFrames)
help: Per-Interface Input/Output PFC Frames Counters

but the metric doesn’t show up in prometheus

from the output of the curl something seems off because this path looks incomplete there should be something like /count/value at the end

but mostly after “count” it’s an array of value, and except for pfc related metrics i haven’t found other metrics given as an array, and i don’t know how to complete the path to get the metric in prometheus and then graph so that we could see in which class we’d have pfc frames indicating a congestion so maybe we’d have to tune a bit our qos policy.

As anyone any idea how this sould be done ?

Regards

 

 

0
Posted by Clément DE FARIA
Answered on October 28, 2021 1:58 pm

For those interested, got an answer from TAC :

 

"Tamás here from EMEA TAC! With eos-native paths you won't be able to make this work as arrays are not supported and with Smash you can't go further down the path, however this works fine with gNMI/OpenConfig and I'd highly recommend using OpenConfig in general and only use eos-native path if the state is not exposed via OpenConfig.

This would also ease your job a lot as in OpenConfig world all paths are standardized so no need to know which platform is using what forwarding agent, so on all your platforms you can use the same types

I've also added a note about this recommendation on our new OpenConfig website: https://aristanetworks.github.io/openmgmt/telemetry/adapters/ocprometheus/#using-ocprometheus-with-the-openconfigocta-agent-management-api-gnmi

The above is the slightly update version of the EOSC article you might have seen before: https://eos.arista.com/streaming-eos-telemetry-states-to-prometheus/

I've just tested this too and it works fine with the below subscription and metric path:

subscriptions:
- /interfaces/interface

metrics:
- name: pfc
path: /interfaces/interface[name=(?P<intf>[^]]+)]/ethernet/pfc/priorities/priority[index=(?P<pfcindex>[0-9])]/state/(?P<pfcCtrType>(?:in-frames|out-frames))

On the Prometheus side this is reflected like this
pfc{intf="Ethernet1",pfcCtrType="in-frames",pfcindex="0"} 0
pfc{intf="Ethernet1",pfcCtrType="in-frames",pfcindex="1"} 0
pfc{intf="Ethernet1",pfcCtrType="in-frames",pfcindex="2"} 0
pfc{intf="Ethernet1",pfcCtrType="in-frames",pfcindex="3"} 0
pfc{intf="Ethernet1",pfcCtrType="in-frames",pfcindex="4"} 0
pfc{intf="Ethernet1",pfcCtrType="in-frames",pfcindex="5"} 0
pfc{intf="Ethernet1",pfcCtrType="in-frames",pfcindex="6"} 0
pfc{intf="Ethernet1",pfcCtrType="in-frames",pfcindex="7"} 0
pfc{intf="Ethernet1",pfcCtrType="out-frames",pfcindex="0"} 0
pfc{intf="Ethernet1",pfcCtrType="out-frames",pfcindex="1"} 0
pfc{intf="Ethernet1",pfcCtrType="out-frames",pfcindex="2"} 0
pfc{intf="Ethernet1",pfcCtrType="out-frames",pfcindex="3"} 0
pfc{intf="Ethernet1",pfcCtrType="out-frames",pfcindex="4"} 0
pfc{intf="Ethernet1",pfcCtrType="out-frames",pfcindex="5"} 0
pfc{intf="Ethernet1",pfcCtrType="out-frames",pfcindex="6"} 0
pfc{intf="Ethernet1",pfcCtrType="out-frames",pfcindex="7"} 0
pfc{intf="Ethernet10",pfcCtrType="in-frames",pfcindex="0"} 0
pfc{intf="Ethernet10",pfcCtrType="in-frames",pfcindex="1"} 0
pfc{intf="Ethernet10",pfcCtrType="in-frames",pfcindex="2"} 0
pfc{intf="Ethernet10",pfcCtrType="in-frames",pfcindex="3"} 0
pfc{intf="Ethernet10",pfcCtrType="in-frames",pfcindex="4"} 0
pfc{intf="Ethernet10",pfcCtrType="in-frames",pfcindex="5"} 0
pfc{intf="Ethernet10",pfcCtrType="in-frames",pfcindex="6"} 0
pfc{intf="Ethernet10",pfcCtrType="in-frames",pfcindex="7"} 0
pfc{intf="Ethernet10",pfcCtrType="out-frames",pfcindex="0"} 0

so I basically labelled the interface, the counter direction and the index

I'll update the github repo later with this example and will remove the pfc path from the eos-native yaml examples (the reason why they were there in the first place is that in older versions those counters might not have been inside an array like you found).

Let me know if you have any questions!

Regards,

Tamas Plugor"

Tested on my side it works as expected with gnmi api.

Kudos to him.

Marked as resolved

Post your Answer

You must be logged in to post an answer.