Skip to content

fix(metrics): track unique cardinality label tuples#203

Open
saurabhhhcodes wants to merge 1 commit into
optiqor:mainfrom
saurabhhhcodes:fix-metrics-cardinality-117
Open

fix(metrics): track unique cardinality label tuples#203
saurabhhhcodes wants to merge 1 commit into
optiqor:mainfrom
saurabhhhcodes:fix-metrics-cardinality-117

Conversation

@saurabhhhcodes

Copy link
Copy Markdown
Contributor

Summary

  • track unique label tuples per metric instead of counting every event
  • keep already-seen label tuples recordable after the cardinality limit is reached
  • apply the guard to the actual labels used by syscall, TCP, disk I/O, scheduler, and FD metrics
  • add regression coverage for new tuple rejection and existing tuple preservation

Fixes #117.

Validation

  • env GOCACHE=/private/tmp/kerno-go-build-cache go test ./internal/metrics -count=1
  • git diff --check

env GOCACHE=/private/tmp/kerno-go-build-cache go test ./... was also attempted, but this macOS sandbox blocks unrelated packages: internal/chaos fails to build on unix.Nanosleep, and internal/ai panics because httptest cannot bind a local port.

@saurabhhhcodes saurabhhhcodes requested a review from btwshivam as a code owner June 8, 2026 09:42
@github-actions github-actions Bot added the level:intermediate 50-200 lines or 3-5 files (auto-applied) label Jun 8, 2026
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

🚀 First PR — welcome aboard!

A few things to expect:

  1. CI: every PR runs build + race tests + lint + (eventually) the kernel matrix. If something fails, the log will tell you exactly which gate.
  2. DCO: every commit needs Signed-off-by:git commit -s adds it automatically.
  3. Conventional Commits: PR titles like feat(doctor): add new rule or fix(bpf): handle X. We squash-merge by default.
  4. Review: a maintainer will review within 72 hours. Suggestions are conversations, not orders — push back if something doesn't fit your context.

If you get stuck, reply here or jump to Discussions. We want this PR to land.

@github-actions github-actions Bot added the testing Tests and test coverage label Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level:intermediate 50-200 lines or 3-5 files (auto-applied) testing Tests and test coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(metrics): cardinality guard counts events, stalls metric for run

1 participant