tynany / frr_exporter

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

Cannot unmarshal bgp description #109

Open mickelmayers opened 8 months ago

mickelmayers commented 8 months ago

Hi,

I'm keep getting below logs on my device. Has any one seen such? I'm running exporter with command: /usr/local/bin/frr_exporter --collector.bgp.peer-descriptions.plain-text --collector.bgp --collector.bgp.peer-types --no-collector.ospf --no-collector.bfd --web.listen-address=0.0.0.0:9342

I've tried with --no-collector.bgp.peer-descriptions.plain-text and all other combinations with --no-collector.bgp.peer-descriptions but nothing seems to help.

2024-02-19T13:17:02.843949+00:00 leaf-1a frr_exporter[20502]: ts=2024-02-19T13:17:02.843Z caller=bgp.go:256 level=error collector=bgp msg="cannot unmarshal bgp description" description=co-r2_priv err="invalid character 'c' looking for beginning of value" 2024-02-19T13:17:02.844032+00:00 leaf-1a frr_exporter[20502]: ts=2024-02-19T13:17:02.843Z caller=bgp.go:256 level=error collector=bgp msg="cannot unmarshal bgp description" description= err="unexpected end of JSON input"

mickelmayers commented 8 months ago

Issue and logs only appear when --collector.bgp.peer-types enabled.

xfy777 commented 6 months ago

same

tynany commented 2 months ago

That is because --collector.bgp.peer-types expects a JSON formatted peer description. Please see https://github.com/tynany/frr_exporter?tab=readme-ov-file#bgp-frr_bgp_peer_types_up for more details, specifically:

To implement this metric, a JSON formatted description must be configured on your BGP group.

The easiest way to get rid of the error is probably to omit --collector.bgp.peer-types.

Let me know how you go