bgpstatus: replace netlink collector with gNMI Get#3674
Draft
juan-malbeclabs wants to merge 2 commits intomainfrom
Draft
bgpstatus: replace netlink collector with gNMI Get#3674juan-malbeclabs wants to merge 2 commits intomainfrom
juan-malbeclabs wants to merge 2 commits intomainfrom
Conversation
Replace the Linux-specific netlink-based BGP session collector with a gNMI Get call to Arista's local gNMI server (/var/run/gnmiServer.sock). - Remove NamespaceCollector, vrfNamespaces(), and namespace switching logic; add BGPCollector interface (no namespace parameter) - Add GNMIClient interface and GNMICollector() that queries all BGP neighbors across all network-instances in a single Get request - Simplify per-user peer IP matching: check both IPs in the /31 tunnel net instead of finding the local tunnel interface first - Remove //go:build linux build tag; code is now platform-agnostic - Consolidate submitter_linux_test.go into submitter_test.go; add tests for parseEstablished, neighborAddress, and tick() with gNMI collector
d6c304d to
c29d24b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
/var/run/gnmiServer.sock), querying all BGP neighbor state across all network instances in a single requestvrfNamespaces,setns) and tunnel interface discovery (FindLocalTunnel); simplify peer IP matching to checking both IPs in the user's /31 tunnel net//go:build linuxbuild tag andBGPNamespaceconfig field; consolidate platform-specific test file into a single cross-platformsubmitter_test.goDiff Breakdown
Net deletion branch: removes more complexity than it adds — namespace switching, netlink, and tunnel discovery logic replaced by a single gNMI call.
Key files (click to expand)
controlplane/telemetry/internal/bgpstatus/submitter.go— removesDefaultCollectorand namespace loop; addsGNMIClientinterface,GNMICollector,parseEstablished,neighborAddress; simplifiestick()to a single collector callcontrolplane/telemetry/internal/bgpstatus/bgpstatus.go— replacesNamespaceCollectorwithBGPCollector(no namespace param, no ifaces return); removesvrfNamespaces,bgpSocket,buildEstablishedIPSet,rootNamespace; addspeerIPsFor31controlplane/telemetry/internal/bgpstatus/submitter_test.go— consolidates two test files; adds tests forparseEstablished,neighborAddress,peerIPsFor31, andtick()with gNMI mockscontrolplane/telemetry/cmd/telemetry/main.go— wires gRPC connection to/var/run/gnmiServer.sock(namespace-aware) and passesGNMICollectorto the submitterTesting Verification
go test ./controlplane/telemetry/internal/bgpstatus/...)parseEstablishedtested against all BGP session states (ESTABLISHED, IDLE, ACTIVE, CONNECT, OPENSENT, OPENCONFIRM), multiple neighbors, and neighbor-address in prefix vs. update path