Skip to content

feat: Serve other registries and lower the floor - #4

Merged
0xmc merged 1 commit into
mainfrom
feat/v0.2.0
Oct 14, 2026
Merged

0xmc merged 1 commit into
mainfrom
feat/v0.2.0

Conversation

@0xmc

@0xmc 0xmc commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

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

  • CI task passes on the Go floor, the latest Go, and the newest controller-runtime
  • Ten deliberate breaks of the new behaviour each fail a test, including each controller-runtime collector variant on its own version
  • A copy of the telemetry query API with controllers linked scrapes with status 200, and infra-provider-gcp builds without a controller-runtime bump
  • After merge, tag v0.2.0 and confirm the module proxy serves it

🤖 Generated with Claude Code

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>
@0xmc
0xmc requested a review from a team as a code owner October 14, 2026 20:11

@ecv ecv left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eye thirteen enn

@0xmc
0xmc merged commit 2dc9672 into main Oct 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support services whose /metrics isn't a controller-runtime manager's

2 participants