Repository navigation
feat: Serve other registries and lower the floor - #4
Merged
Merged
Conversation
Services whose /metrics isn't a controller-runtime manager's, such as a k8s.io/apiserver, strand every metric created through the library. Serving both registries naively fails each scrape once controllers are linked, because both carry the Go runtime and process metrics. Key changes: - add metrics.WithGatherers, dropping controller-runtime's runtime collectors when another registry already exports them - add instrumenttest.AssertScrapes to catch series two registries share - flag legacyregistry registration and legacyregistry.Handler, and allow prometheus.DefaultGatherer passed to WithGatherers - reword messages that assumed controller-runtime - lower the controller-runtime floor to v0.20.4 Closes #3 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #3.
Lets a service whose metrics endpoint isn't a controller-runtime manager's, such as a k8s.io/apiserver, serve its own registries alongside the library's, and adds a test helper that fails when two registries export the same series. The handler drops controller-runtime's Go runtime and process collectors when another registry already exports them, which is the one overlap every apiserver that also runs controllers hits. The stranded-metrics check now covers component-base's registry, its messages no longer assume controller-runtime, and the controller-runtime floor drops to v0.20.4 so infra-provider-gcp can adopt it.
Test plan
🤖 Generated with Claude Code