Repository navigation
refactor(fabric): Create fabric routing metrics with the library - #1189
Merged
Merged
Conversation
This was referenced Oct 28, 2026
privateip
force-pushed
the
fix/issue-1149-fabric-routing
branch
from
October 28, 2026 14:14
69fe42b to
187fc3a
Compare
11 tasks
fabric-config-agent served a private registry holding the next-hop guard's and the activation path's metrics, and fabric-router-controller registered its fleet collector on controller-runtime's registry directly. The instrumentation library's checks saw neither. - NewNextHopMetrics and NewAgentMetrics create their series with the library's constructors. The library's registry keeps a series across calls, so each call starts its vectors over. NextHopMetrics no longer carries a registry or a handler. - fabric-config-agent serves metrics.Handler at /metrics. The endpoint keeps every series it had and adds instrumentation_build_info. - The fleet collector registers through metrics.MustRegister. The agent's scrape test creates its series first and lints them. The controller's test registers the fleet collector, which emits nothing until it leads, to check that its descriptors fit beside the rest. Refs: #1149 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fleet 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-fabric-routing
branch
from
October 28, 2026 14:22
187fc3a to
01c4d9d
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.
Next-hop guard, agent activation and fleet metrics keep their names, labels and buckets. fabric-config-agent now serves the library's handler at /metrics, so the series the agent exposes are the same ones, on the registry the constructors now use.
- /metrics gains Go, process and
instrumentation_build_infoseries, which the private registry did not have. Additive. - The fleet collector in
fabric-router-controllerisMustRegistered on the manager's registry as before; only the failure mode changes (panic instead of a returned error). NewNextHopMetricsandNewAgentMetricsreset their vectors on each call; each is called once innewMetrics.
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
fabric-config-agent served a private registry holding the next-hop guard's and activation path's metrics, and fabric-router-controller registered its fleet collector on controller-runtime's registry directly, so the instrumentation library saw neither.
Both now go through the library, and the agent serves the library's handler.
Stack
Merge in order:
Compatibility
The agent's endpoint keeps every series and adds only the build-info series. The controller's endpoint is unchanged. Rolling back restores the previous code with no other effect.
Test plan
Related to #1149
🤖 Generated with Claude Code