fix(observability): correct GittensoryHighJobFailureRatio alert formula - #3908
Conversation
gittensory_jobs_processed_total only increments on success, so dividing failed-job rate by it alone computed failed:success instead of a true failure percentage -- a genuine 50% failure rate read as 100%. Sum both counters in the denominator to match the Grafana dashboard's formula. Closes #3892
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-07 06:16:04 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 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 #3908 +/- ##
=======================================
Coverage 93.57% 93.57%
=======================================
Files 357 357
Lines 34309 34309
Branches 12557 12557
=======================================
Hits 32105 32105
Misses 1580 1580
Partials 624 624 🚀 New features to boost your workflow:
|
Summary
GittensoryHighJobFailureRatiodivided failed-job rate bygittensory_jobs_processed_totalalone. That counter only increments on success, so the expr computed failed:success instead of a true failure percentage — a genuine 50% failure rate read as 100%, and the alert both fired far earlier than its stated 10% threshold and misreported the value in its page text._persisted_totalmetrics.prometheus/rules/alerts.yml.Found via a fresh performance/scalability/accuracy hardening audit of the self-host ORB stack. Tracked under #1667.
Scope
prometheus/rules/alerts.yml— corrected expr + updated comment/description texttest/unit/alerts-job-failure-ratio-formula.test.ts— new regression testValidation
npm run typechecknpm run selfhost:validate-observability(dashboards + alert rules valid)npx vitest run test/unit/alerts-job-failure-ratio-formula.test.ts test/unit/validate-observability-configs-script.test.ts test/unit/docs-selfhost-troubleshooting-metric-names.test.ts test/unit/selfhost-grafana-dashboard.test.ts— all greengit diff --checkcleanSafety
src/**lines touched, no secrets, no behavior change beyond the alert's own threshold math.Closes #3892