Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ocprometheus fails with duplicated metrics with EOS 4.27 #67

Open
freedge opened this issue May 3, 2022 · 1 comment
Open

ocprometheus fails with duplicated metrics with EOS 4.27 #67

freedge opened this issue May 3, 2022 · 1 comment

Comments

@freedge
Copy link

freedge commented May 3, 2022

Using latest goarista from master branch, EOS 4.27.4M, and a configuration like this:

metrics:

        - name: ocprometheus_bgp_peer_as_number  #No unit
          path: /Sysdb/routing/bgp/export/vrfBgpPeerInfoStatusEntryTable/(?P<vrf>.+)/bgpPeerInfoStatusEntry/(?P<name>.+)/bgpPeerAs
          help: BGP Peer  AS Number

ocprometheus fails with errors like this:

* collected metric "ocprometheus_bgp_peer_as_number" { label:<name:"name" value:"192.168.247.17" > label:<name:"vrf" value:"default" > gauge:<value:0 > } was collected before with the same name and label values

This used to work so far with EOS <= 4.26.6M :

ocprometheus_bgp_peer_as_number{name="10.64.226.33/bgpPeerSessionStatus",vrf="default"} 1234
ocprometheus_bgp_peer_as_number{name="10.64.226.35/bgpPeerSessionStatus",vrf="default"} 1234
ocprometheus_bgp_peer_as_number{name="192.168.247.19/bgpPeerSessionStatus",vrf="default"} 64850
ocprometheus_bgp_peer_as_number{name="192.168.248.19/bgpPeerSessionStatus",vrf="default"} 64850

It looks like the name "(?P.+)" used to match "10.64.226.33/bgpPeerSessionStatus", but now it only constructs a label with the first part before the first "/"

@freedge
Copy link
Author

freedge commented May 3, 2022

workaround for my use case is to replace

path: /Sysdb/routing/bgp/export/vrfBgpPeerInfoStatusEntryTable/(?P<vrf>.+)/bgpPeerInfoStatusEntry/(?P<name>.+)/bgpPeerAs

with

path: /Sysdb/routing/bgp/export/vrfBgpPeerInfoStatusEntryTable/(?P<vrf>.+)/bgpPeerInfoStatusEntry/(?P<name>.+)/bgpPeerSessionStatus/bgpPeerAs

so a single bgpPeerAs is found and there is no path included in "name".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant