Skip to content

feat: krane+ctrl metrics struct DI, per-service registries, cleanup#5663

Closed
Flo4604 wants to merge 1 commit into04-08-sentinel_metrics_struct_difrom
04-08-krane_ctrl_registry_wiring
Closed

feat: krane+ctrl metrics struct DI, per-service registries, cleanup#5663
Flo4604 wants to merge 1 commit into04-08-sentinel_metrics_struct_difrom
04-08-krane_ctrl_registry_wiring

Conversation

@Flo4604
Copy link
Copy Markdown
Member

@Flo4604 Flo4604 commented Apr 8, 2026

What does this PR do?

Fixes # (issue)

If there is not an issue for this, please create one first. This is used to tracking purposes and also helps us understand why this PR exists

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Chore (refactoring code, technical debt, workflow improvements)
  • Enhancement (small improvements)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How should this be tested?

  • Test A
  • Test B

Checklist

Required

  • Filled out the "How to test" section in this PR
  • Read Contributing Guide
  • Self-reviewed my own code
  • Commented on my code in hard-to-understand areas
  • Ran pnpm build
  • Ran pnpm fmt
  • Ran make fmt on /go directory
  • Checked for warnings, there are none
  • Removed all console.logs
  • Merged the latest changes from main onto my branch with git pull origin main
  • My changes don't cause any responsiveness issues

Appreciated

  • If a UI change was made: Added a screen recording or screenshots to this PR
  • Updated the Unkey Docs if changes were necessary

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dashboard Ready Ready Preview, Comment Apr 9, 2026 3:09pm

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 8, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 59f3b520-74dc-48d2-8221-6c2b1da923a2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 04-08-krane_ctrl_registry_wiring

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Member Author

Flo4604 commented Apr 8, 2026

@Flo4604 Flo4604 force-pushed the 04-08-krane_ctrl_registry_wiring branch from 7bba4b4 to 12da9bb Compare April 8, 2026 14:37
@Flo4604 Flo4604 force-pushed the 04-08-sentinel_metrics_struct_di branch from 2b60c6a to bac0e94 Compare April 8, 2026 14:37
@Flo4604 Flo4604 force-pushed the 04-08-sentinel_metrics_struct_di branch from bac0e94 to 4b5107b Compare April 8, 2026 15:03
@Flo4604 Flo4604 force-pushed the 04-08-krane_ctrl_registry_wiring branch from 12da9bb to 5991772 Compare April 8, 2026 15:03
@Flo4604 Flo4604 force-pushed the 04-08-sentinel_metrics_struct_di branch from 4b5107b to f213b22 Compare April 8, 2026 20:04
@Flo4604 Flo4604 force-pushed the 04-08-krane_ctrl_registry_wiring branch from 5991772 to eebfced Compare April 8, 2026 20:04
@Flo4604 Flo4604 force-pushed the 04-08-krane_ctrl_registry_wiring branch from eebfced to 58fce23 Compare April 9, 2026 09:16
@Flo4604 Flo4604 force-pushed the 04-08-sentinel_metrics_struct_di branch from f213b22 to 6519268 Compare April 9, 2026 09:16
@Flo4604 Flo4604 force-pushed the 04-08-krane_ctrl_registry_wiring branch from 58fce23 to 04b841d Compare April 9, 2026 12:46
@Flo4604 Flo4604 force-pushed the 04-08-sentinel_metrics_struct_di branch from 6519268 to 61be2bb Compare April 9, 2026 12:46
Convert krane (9 vars) and ctrl (4 vars) metrics to Metrics struct DI.

Wire up per-service prometheus.NewRegistry() in all 6 services:
- frontline, sentinel, krane, ctrl/api, ctrl/worker, api
Each service creates its own registry, registers only the metrics it
uses via NewMetrics(reg), and serves via NewWithRegistry(reg).

Remove deprecated New() and Serve() from pkg/prometheus/server.go.

This eliminates ~24k permanently-zero series across the fleet.
@Flo4604 Flo4604 force-pushed the 04-08-krane_ctrl_registry_wiring branch from 04b841d to b8d1579 Compare April 9, 2026 15:04
@Flo4604 Flo4604 force-pushed the 04-08-sentinel_metrics_struct_di branch from 61be2bb to 070b9fb Compare April 9, 2026 15:04
@Flo4604 Flo4604 closed this Apr 9, 2026
@Flo4604 Flo4604 deleted the 04-08-krane_ctrl_registry_wiring branch April 10, 2026 17:24
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.

1 participant