From 8d155964f7ef28d8ddca0190f8e36a116ee4d1b6 Mon Sep 17 00:00:00 2001 From: Florian Domain Date: Thu, 10 Sep 2026 15:56:31 +0200 Subject: [PATCH] metrics: fix the peer type values in the bgp_peer_type help text The help text and inline comment documented internal as 0 and external as 1, but the metric reports the api.PeerType protobuf enum, where internal is 1 and external is 2. Unspecified (0) is never emitted: toPeerType maps every non-external value to internal. Signed-off-by: Florian Domain --- pkg/metrics/metrics.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/metrics/metrics.go b/pkg/metrics/metrics.go index 175e538c8..038854904 100644 --- a/pkg/metrics/metrics.go +++ b/pkg/metrics/metrics.go @@ -223,7 +223,7 @@ var ( ) bgpPeerTypeDesc = prometheus.NewDesc( prometheus.BuildFQName(namespace, "peer", "type"), - "Type of the BGP peer, internal (0) or external (1)", + "Type of the BGP peer, internal (1) or external (2)", peerLabels, nil, ) bgpPeerAsnDesc = prometheus.NewDesc( @@ -350,7 +350,7 @@ func (c *bgpCollector) Collect(out chan<- prometheus.Metric) { send(bgpPeerSendCommunityFlagDesc, uint64(peerState.GetSendCommunity())) // Whether BGP Private AS is being removed (1) or not (0) send(bgpPeerRemovePrivateAsFlagDesc, uint64(peerState.GetRemovePrivate())) - // Peer Type (0) for internal, (1) for external + // Peer Type (1) for internal, (2) for external send(bgpPeerTypeDesc, uint64(peerState.GetType())) // Whether authentication password is being set (1) or not (0)