geoprobe-agent: add Prometheus metrics instrumentation#3371
Merged
Conversation
ben-dz
approved these changes
Mar 24, 2026
Contributor
ben-dz
left a comment
There was a problem hiding this comment.
LGTM. A few notes, but could be merged as is.
Future improvement might be bubble up reporting from the signed twamp reflector and the outbound pinger.
Contributor
Author
|
Addressed PR feedback:
|
cd18020 to
2fd540d
Compare
Add build info, error counters, operation duration histograms, offset tracking counters, and discovery gauges to the geoprobe-agent. Metrics are defined in a new geolocation_metrics.go file and exposed via an HTTP /metrics endpoint when --metrics-enable is set.
Remove unused error type constants (parent_discovery, target_discovery) and add custom histogram buckets for discovery and measurement cycle duration metrics to better capture RPC-heavy operations.
2fd540d to
e448651
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.
Resolves: #2941
Summary of Changes
--metrics-enableand--metrics-addrflags/metricsHTTP endpoint usingpromhttp.Handler()when enabledDiff Breakdown
Mostly metric definitions (scaffolding); the core logic is lightweight instrumentation calls wired into existing code paths.
Key files (click to expand)
controlplane/telemetry/internal/metrics/geolocation_metrics.go— new file defining all Prometheus metric vars, constants for error types and rejection reasonscontrolplane/telemetry/cmd/geoprobe-agent/main.go— adds--metrics-enable/--metrics-addrflags, HTTP metrics server goroutine, and metric increment/observe calls at key pointsTesting Verification
make go-buildcompiles cleanly with the new metrics package and importsmake go-lintpasses with no new warnings--metrics-enabledefaults to false), so existing deployments are unaffected