-
Notifications
You must be signed in to change notification settings - Fork 9
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
Gateway routes imported/exported/preferred metrics #477
Conversation
435c6ea
to
5868315
Compare
213ddb9
to
5254e29
Compare
5254e29
to
46d4c73
Compare
Here is a small experiment regarding cpu consumption with 2 exported routes and 1 imported. |
95c6cd0
to
78f29ee
Compare
routesPreferred: 0, | ||
} | ||
|
||
routes := regex.FindAllString(protocol, -1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a lot of hassle with all those string operations that follow.
Wouldn't a regex using group matching be easier? https://regex101.com/r/SV8ouF/1
Then you could rely on the single map approach from here: https://stackoverflow.com/questions/60109288/regex-named-groups-in-golang
(You should be looking for 1 match per protocol if I got it right.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know, I find it easier to maintain and troubleshoot this than a complex regex
ctx, | ||
observer, | ||
func(birdStats *BirdStats) int64 { | ||
return int64(birdStats.routesImported) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feels clumsy that the same operation has to be repeated 3 times in the background because 3 values must be extracted. Isn't there some recommendation in opentelemtry how to avoid this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I don't think opentelemtry gives any recommendation. they are different types of metrics, like rx/tx bytes/packets for an interface.
Btw. with 100 000 IPv4 routes (net prefix /32) in Kind on my machine: |
Thanks for checking this, it seems acceptable. Usually Prometheus should fetch the metrics so often. |
Collect metrics of routes imported, exported and preferred for each gateways. The metrics are extracted and parsed from show protocol all command in bird.
78f29ee
to
fef1cbc
Compare
Description
Collect metrics of routes imported, exported and preferred for each gateways. The metrics are extracted and parsed from show protocol all command in bird.
Issue link
#419
Checklist