Repository navigation
refactor(edge): Create edge metrics with the instrumentation library - #1188
Merged
Merged
Conversation
This was referenced Oct 28, 2026
privateip
force-pushed
the
fix/issue-1149-edge
branch
from
October 28, 2026 14:14
43f1d54 to
46ad063
Compare
11 tasks
The Edge foundation's failure counters and the core and node collectors were registered on controller-runtime's registry directly, so the instrumentation library's checks skipped them. The failure counters carried a component constant label naming the emitting role. The collection pipeline sets component on every series from the pod's labels, so the library refuses it. The label is now edge_role, with the same values: core from galactic-controller and node from galactic-edge. No shipped alert rule or rule test reads it. - diag.NewMetrics takes only the role and creates the counters with the library's constructors. The library's registry keeps a series across calls, so each call starts the role's counters over. - The state and node collectors register through metrics.MustRegister. - diagtest.New returns a Gatherer reading back only that role's counters from the library's registry, in place of a private registry. The scrape tests create the series run creates and lint them, and the controller's test includes the state collector over an empty cluster. Refs: #1149 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Edge state collector can be registered once per process, as run does. TestMetricsScrape registered it on every run, so a second run in the same test process, such as go test -count=2, panicked on the duplicate. Its setup now runs once. Refs: #1149 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
privateip
force-pushed
the
fix/issue-1149-edge
branch
from
October 28, 2026 14:22
46ad063 to
99f7136
Compare
privateip
marked this pull request as ready for review
October 28, 2026 14:58
scotwells
previously approved these changes
Oct 28, 2026
ecv
previously approved these changes
Oct 28, 2026
ecv
left a comment
Contributor
There was a problem hiding this comment.
Approve.
One exported series changes shape: the three galactic_edge_foundation_* counters (failures_total, gate_closures_total, cleanup_failures_total) swap their constant label component for edge_role, because component is reserved by the collection pipeline and the library panics on it. The names, other labels and values are unchanged.
- Infra impact: the only consumer is the staging
GalacticEdgeCleanupFailingrule, which filters onjoband never mentionscomponent, so it keeps working. A firing instance would carry a new label set and go pending again for its 15mfor; staging only. - No infra dashboard, recording rule or other alert references
galactic_edge_foundation_failures_totalor_gate_closures_total; out-of-repo consumers of thecomponentlabel on these three would break. NewMetrics(role)resets the role's series on each call and is called once per process;StateCollectorandagent.Collectorregister viaMustRegisteron the manager's registry.
Follow-ups:
- Note the
componenttoedge_rolerename in the release notes so anyone with an out-of-repo query can update it.
privateip
dismissed stale reviews from ecv and scotwells
October 28, 2026 15:06
The merge-base changed after approval.
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
The Edge foundation's failure counters and its core and node collectors were registered on controller-runtime's registry directly, so the instrumentation library's checks skipped them.
One label on the failure counters has a name the collection pipeline sets on every series itself, so the library refuses it at startup. It is renamed with the same values, and the counters and collectors now go through the library.
Stack
Merge in order:
Breaking changes
galactic_edge_foundation_failures_total,galactic_edge_foundation_gate_closures_totalandgalactic_edge_foundation_cleanup_failures_totalcarryedge_rolein place ofcomponent. No shipped alert rule, rule test or downstream copy of the rules reads it. The release notes need the rename.Rolling back restores the old label name.
Test plan
Related to #1149, #1150
🤖 Generated with Claude Code