fix(selfhost): wire or remove the dead gittensory_jobs_deferred_total metric#2574
Conversation
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-02 10:32:11 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 3 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2574 +/- ##
==========================================
+ Coverage 95.97% 95.98% +0.01%
==========================================
Files 226 229 +3
Lines 25533 25810 +277
Branches 9293 9389 +96
==========================================
+ Hits 24505 24774 +269
- Misses 417 425 +8
Partials 611 611 🚀 New features to boost your workflow:
|
gittensory_jobs_deferred_total was registered as a persisted gauge in server.ts (reading backend.queue.stats()["gittensory_jobs_deferred_total"]) but no code path in sqlite-queue.ts or pg-queue.ts ever calls recordQueueMetric(driver, "gittensory_jobs_deferred_total", ...) -- dead instrumentation that always reports 0. The similarly-named (and actually incremented) gittensory_jobs_rate_limit_deferred_total / gittensory_jobs_rate_limit_admission_deferred_total / gittensory_jobs_rate_limit_budget_deferred_total exist and ARE recorded, so this reads as a leftover/renamed metric from an earlier iteration rather than something intentionally deferred. No self-host Grafana dashboard JSON references this metric name, so remove the dead gauge registration rather than inventing new call sites for a metric name nothing currently depends on.
Address the gate review's test-expectations concern on the dead gittensory_jobs_deferred_total removal directly, rather than treating it as a policy-heuristic override: assert every metric name in server.ts's persisted-gauge list has a real recordQueueMetric call site in both queue drivers, so a future dead entry can't reappear the same way without a test catching it.
2571c31 to
484e3aa
Compare
Summary
gittensory_jobs_deferred_totalwas registered as a persisted gauge insrc/server.ts(readingbackend.queue.stats()["gittensory_jobs_deferred_total"]), but no code path insqlite-queue.tsorpg-queue.tsever callsrecordQueueMetric(driver, "gittensory_jobs_deferred_total", ...)— confirmed both queue drivers only ever recordenqueued/processed/failed/dead/rate_limited/rate_limit_deferred/coalesced/recovered, never a baredeferred. Dead instrumentation that always reports 0, giving a false sense that no deferrals are happening.gittensory_jobs_rate_limit_deferred_total/gittensory_jobs_rate_limit_admission_deferred_total/gittensory_jobs_rate_limit_budget_deferred_totalexist and ARE recorded, so this reads as a leftover/renamed metric from an earlier iteration rather than something intentionally deferred.grep -rn "gittensory_jobs_deferred_total"across the repo only matched the one dead registration), so removed the registration rather than inventing new call sites for a metric name nothing currently depends on.Closes #2508.
Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally —src/server.tsis Codecov-ignored, so this one-line removal carries no patch coverage obligation.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateSafety
UI Evidencesection below — N/A, no UI changes.Notes