tynany / frr_exporter

Prometheus exporter for Free Range Routing
MIT License
97 stars 35 forks source link

json: cannot unmarshal number into Go struct field bgpPeerSession.Peers.PeerUptimeMsec of type uint32 #72

Closed 5eb38fd8cdee closed 2 years ago

5eb38fd8cdee commented 2 years ago

Hello,

I am trying out the FRR Exporter on a lab environment, and I am running into issues when I try to obtain data from FRR Exporter. This is the error message:

err="cannot process output of show bgp vrf all ipv4 unicast summary json: json: cannot unmarshal number 8465643000 into Go struct field bgpPeerSession.Peers.PeerUptimeMsec of type uint32

Full output:


level=info ts=2022-05-17T17:46:34.056Z caller=frr_exporter.go:65 msg="Starting frr_exporter" version="(version=1.1.1, branch=HEAD, revision=d0d5ec547513a0995543e1da6f44d18491d0e44f)"
level=info ts=2022-05-17T17:46:34.056Z caller=frr_exporter.go:66 msg="Build context" build_context="(go=go1.17.9, user=root@e633ce4eab46, date=20220423-00:54:13)"
level=info ts=2022-05-17T17:46:34.056Z caller=frr_exporter.go:67 msg="Listening on address" address=[fc00::115b]:9342
level=info ts=2022-05-17T17:46:34.057Z caller=tls_config.go:191 msg="TLS is disabled." http2=false

level=error ts=2022-05-17T17:46:40.374Z caller=collector.go:126 msg="collector scrape failed" name=bgp duration_seconds=0.002062469 err="cannot process output of show bgp vrf all ipv4 unicast summary json: json: cannot unmarshal number 8465643000 into Go struct field bgpPeerSession.Peers.PeerUptimeMsec of type uint32: command output: {\n\"default\":{\n  \"routerId\":\"10.1.24.16\",\n  \"as\":4200020115,\n  \"vrfId\":0,\n  \"vrfName\":\"default\",\n  \"tableVersion\":66,\n  \"ribCount\":9,\n  \"ribMemory\":1728,\n  \"peerCount\":2,\n  \"peerMemory\":43616,\n  \"peerGroupCount\":1,\n  \"peerGroupMemory\":64,\n  \"peers\":{\n    \"swp10\":{\n      \"hostname\":\"ENGSW14L\",\n      \"remoteAs\":4200010114,\n      \"version\":4,\n      \"msgRcvd\":2823776,\n      \"msgSent\":2824093,\n      \"tableVersion\":0,\n      \"outq\":0,\n      \"inq\":0,\n      \"peerUptime\":\"13w6d23h\",\n      \"peerUptimeMsec\":8465643000,\n      \"peerUptimeEstablishedEpoch\":1644343957,\n      \"pfxRcd\":4,\n      \"pfxSnt\":5,\n      \"state\":\"Established\",\n      \"connectionsEstablished\":7,\n      \"connectionsDropped\":6,\n      \"idType\":\"interface\"\n    },\n    \"172.20.24.5\":{\n      \"hostname\":\"engsw18\",\n      \"remoteAs\":4200000118,\n      \"version\":4,\n      \"msgRcvd\":2823769,\n      \"msgSent\":2824066,\n      \"tableVersion\":0,\n      \"outq\":0,\n      \"inq\":0,\n      \"peerUptime\":\"09w0d16h\",\n      \"peerUptimeMsec\":5500966000,\n      \"peerUptimeEstablishedEpoch\":1647308634,\n      \"pfxRcd\":4,\n      \"pfxSnt\":5,\n      \"state\":\"Established\",\n      \"connectionsEstablished\":5,\n      \"connectionsDropped\":4,\n      \"idType\":\"ipv4\"\n    }\n  },\n  \"failedPeers\":0,\n  \"totalPeers\":2,\n  \"dynamicPeers\":0,\n  \"bestPath\":{\n    \"multiPathRelax\":\"true\"\n  }\n}\n}\n"
mdtancsa commented 2 years ago

Hi, I just ran into this issue as well. Is there any reason not to use the json-field-types-2 branch ?

33Fraise33 commented 2 years ago

Hi, I can confirm I also have this issue. Another host with a similar config does not have this issue. it seems to be related to the upgrade from 1.1.0 to 1.1.1 for me.