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

[feat] Add bgp metrics (bgp_session_info) #561

Merged
merged 4 commits into from
May 10, 2023

Conversation

jonasbadstuebner
Copy link
Contributor

As described in #547, this PR adds the metrics to monitor the current state of the bgp sessions.

The port of the peer is hard coded, since it is not currently possible to change the port in kube-vip. As soon as this feature is implemented, the port will be accessible by using the peers state, similar to GetNeighborAddress().
If this should be refactored later, just tell me and I append the 179 in the peerDescription directly.

Example metrics look like this:

# HELP bgp_session_info Display state of session by setting metric for label value with current state to 1
# TYPE bgp_session_info gauge
bgp_session_info{peer="123.4.123.4:179",state="ACTIVE"} 0
bgp_session_info{peer="123.4.123.4:179",state="CONNECT"} 0
bgp_session_info{peer="123.4.123.4:179",state="ESTABLISHED"} 1
bgp_session_info{peer="123.4.123.4:179",state="IDLE"} 0
bgp_session_info{peer="123.4.123.4:179",state="OPENCONFIRM"} 0
bgp_session_info{peer="123.4.123.4:179",state="OPENSENT"} 0
bgp_session_info{peer="123.4.123.4:179",state="UNKNOWN"} 0
bgp_session_info{peer="123.4.123.5:179",state="ACTIVE"} 0
bgp_session_info{peer="123.4.123.5:179",state="CONNECT"} 0
bgp_session_info{peer="123.4.123.5:179",state="ESTABLISHED"} 1
bgp_session_info{peer="123.4.123.5:179",state="IDLE"} 0
bgp_session_info{peer="123.4.123.5:179",state="OPENCONFIRM"} 0
bgp_session_info{peer="123.4.123.5:179",state="OPENSENT"} 0
bgp_session_info{peer="123.4.123.5:179",state="UNKNOWN"} 0

Signed-off-by: Jonas Badstübner <jonas.badstuebner@hetzner-cloud.de>
Signed-off-by: Jonas Badstübner <jonas.badstuebner@hetzner-cloud.de>
Signed-off-by: Jonas Badstübner <jonas.badstuebner@hetzner-cloud.de>
Signed-off-by: Jonas Badstübner <jonas.badstuebner@hetzner-cloud.de>
@thebsdbox
Copy link
Collaborator

This is excellent ! (Thankyou ! )

@jonasbadstuebner
Copy link
Contributor Author

Regarding the failing check: Is this something I broke? I think I didn't even touch these files...so I guess not?
Please let me know.

@jonasbadstuebner
Copy link
Contributor Author

I think #557 should fix this, right? :)

@thebsdbox
Copy link
Collaborator

Yeah, the linter was updated recently and it's generating a load of noise in old code. 🙄

@thebsdbox
Copy link
Collaborator

If this is good to go, I'm happy to merge as is.

Copy link
Collaborator

@thebsdbox thebsdbox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/LGTM

@jonasbadstuebner
Copy link
Contributor Author

From my side, it's ready to merge. If there are any issues occurring or changes wanted by others, I will propose a follow up PR.

@thebsdbox thebsdbox merged commit f03917e into kube-vip:main May 10, 2023
3 of 4 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants