Repository navigation
refactor(fabric-api): Create metrics with the instrumentation library - #1190
Merged
Merged
Conversation
This was referenced Oct 28, 2026
privateip
force-pushed
the
fix/issue-1149
branch
from
October 28, 2026 14:14
570c7ae to
ed7baf4
Compare
11 tasks
The fabric-api gateway registered its metrics on a registry passed in from the command, and the node sidecar served a private registry. The instrumentation library's checks saw neither, and the adoption test still skipped them. - Both roles create their metrics with the library's constructors, and each NewMetrics starts its vectors over, because the library's registry keeps a series across calls. - The library creates a function metric only once per process, so the queue depth, service switch, admission, clock and search index gauges are created on the first call that needs them and read the source the latest call gave them. A series that only exists in one mode still only exists there. - The node sidecar serves metrics.Handler. Its endpoint keeps every series it had and adds instrumentation_build_info, the full Go runtime set where the private registry had the basic Go collector, and the controller-runtime and certificate watcher series the shared registry holds. - Both roles define fabric_api_certificate_expiry_timestamp_seconds, with help text naming one certificate each. The help now names both, so the two definitions agree on one registry. With every directory migrated, the adoption test's skip list and the code that applied it are gone. The scrape test creates both roles' startup series and lints them. Fixes #1149 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
privateip
force-pushed
the
fix/issue-1149
branch
from
October 28, 2026 14:22
ed7baf4 to
ea6f828
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.
Every fabric_api_gateway_* and fabric_api_node_* series keeps its name, type, labels, buckets and constant afi label; function metrics are now created once and read a swappable source, with the same values. The node sidecar now serves the shared registry with the library's handler, and its Go and process series are still present. CI is green.
- HELP text of
fabric_api_certificate_expiry_timestamp_secondschanges to one shared string, since gateway and node define the same name and the library requires one definition. Series, labels and values are unchanged. - The node's /metrics now includes whatever controller-runtime registers on its registry (extra Go runtime series,
instrumentation_build_info). Additive. fabric_api_node_bmp_route_messages_totalis now created inRegisterIndex, soBMPMessage()is a no-op before it runs. A node always callsRegisterIndex, so the exported series is unchanged;idleUnconfiguredexports no index series either way, as before.- Nothing in infra queries a series whose name or labels changed.
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 fabric-api gateway registered its metrics on a registry passed in from the command, and the node sidecar served a private registry, so the adoption test still skipped both.
Both roles now create their metrics through the library, and the node sidecar serves the library's handler. A gauge that reads state when scraped is created on the first call that needs it, so a series that only exists in one mode still only exists there.
With this layer the adoption test runs with no directory skipped.
Stack
Merge in order:
Compatibility
The gateway endpoint is unchanged. The node sidecar keeps all of its series and gains the build-info series, the full Go runtime set in place of the basic one, and a few controller-runtime and certificate watcher families.
Both roles export a certificate expiry gauge, and its help text now names both certificates so the two definitions agree. Rolling back restores the previous code with no other effect.
Test plan
Fixes #1149
🤖 Generated with Claude Code