agent: log config size in bytes and expose size metrics#3743
Merged
Conversation
elitegreg
approved these changes
May 22, 2026
Adds a sibling log line in the Arista eapi config-session start reporting the received config payload size in bytes, alongside the existing line-count log. Also exposes two new Prometheus gauges set from pollControllerAndConfigureDevice after each successful pull from the controller: - doublezero_agent_config_size_in_lines - doublezero_agent_config_size_in_bytes Gauges (not counters) since size of the most-recently-received config can move up or down between polls. Empty controller responses set both gauges to 0. Refs #3741
76cadcf to
30c7bb0
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
EAPIClient.startConfigSessionreporting the received config payload size in bytes, alongside the existing line-count log. Operators asked for byte-size visibility on every config push.doublezero_agent_config_size_in_bytesanddoublezero_agent_config_size_in_lines— set frompollControllerAndConfigureDeviceafter each successful pull from the controller. Gauges (not counters) because the size of the most-recently-received config can move up or down between polls.0, so an empty-poll signal is consistent across both metrics.Testing Verification
go build ./controlplane/agent/...succeeds on the merged branch.go test ./controlplane/agent/...passes (internal/agentandpkg/arista).gofmt -l controlplane/agent/is clean.