feat(gobgp): add kube_router_bgp_peer_info metric#2003
feat(gobgp): add kube_router_bgp_peer_info metric#2003aauren merged 1 commit intocloudnativelabs:masterfrom
Conversation
|
made isolated testing for the changes on the same node made simplified bird2 bgp config this is the metric before connection is established: and this is after: |
edfb8b5 to
f49bc36
Compare
|
i did see that workflows got an approval and received message about this: https://github.com/cloudnativelabs/kube-router/actions/runs/22016039123/job/63619708028 pipeline here complained about not handling SESSION_STATE_UNSPECIFIED. i originally map all others states and had fallback to 'unknown' (unspecified is supposed to be 'unknown'). so i have added mapping for this 'unspecified' case too and it satisfies linter. i did run lint locally and it passed please run pipeline again |
|
maybe we want to distinguish here if it is ibgp or ebgp peer (internal/external) ? i can add it here or as a separate pull request if that's acceptable |
f49bc36 to
8985458
Compare
|
i thought about it and added type = ibgp/ebgp. that's before establishing connection with bird2 and that's after and this is ebgp with other 'host' that's before establishing connection with bird2 that's after |
|
Hey @damex - Thanks for the contribution, I've been slammed the past couple of weeks, but I'll try to take a look at this one and your other one for SCTP support as soon as possible. |
catherinetcai
left a comment
There was a problem hiding this comment.
Thank you so much for your detailed notes and thorough testing @damex! I only have very, very minor comments here.
0f334ee to
a200fd2
Compare
Replace the misleading kube_router_controller_bgp_peers gauge which only counts 'cluster nodes' with a new per peer metric kube_router_bgp_peer_info with 'GaugeVec' that exposes actual BGP session state from gobgp. labels include peer address, asn, type, and state. Metric value is 1 if established and 0 otherwise. Closes: cloudnativelabs#848 Signed-off-by: Roman Kuzmitskii <roman@damex.org>
fa2d078 to
0be45ff
Compare
|
Hey @damex apologies for getting to this late. Thanks for the contribution! Everything looks good here, and I agree with all of @catherinetcai's suggestions. I tried deploying it and it looks good to me. |
Replace the misleading kube_router_controller_bgp_peers gauge
which only counts 'cluster nodes'. with a new per peer metric
kube_router_bgp_peer_info with 'GaugeVec' that exposes actual
BGP session state from gobgp. labels include peer address, asn,
and session state. metric value is 1 if established and 0 otherwise.
Closes: #848