Repository navigation
monitoring: alert on unknown reason-enum ratio - #22446
Git-on-my-level merged 1 commit into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b8bfb720ff
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "instatus_component": "api", | ||
| "severity": "warning" | ||
| }, | ||
| "isPaused": false, |
There was a problem hiding this comment.
Keep the alert paused until its counters are live
When this revision is provisioned before companion PR #22422, no backend source declares or emits either metric (the same change has to add them to PENDING_BACKEND_ALERT_METRICS), and noDataState: OK turns every evaluation into a healthy result. Marking the rule unpaused therefore ships a dead alert and also lets the later producer rollout activate its unbacktested 2% threshold without the live replay/admission review required by backend/charts/monitoring/README.md lines 1383-1389; keep it paused under an admission_holds entry until the counters are deployed and the exact expression has good/bad evidence.
Useful? React with 👍 / 👎.
…ce on integration #22446 (main) allowed the reason-ratio alert to land before its producers, with a test that fails once a producer is declared. The lane-1 stub (#22420) already declares omi_reason_unknown_total, so after the #22388 sync every integration PR failed test_pending_backend_alert_metric_allowances_expire_when_the_producer_lands. Keep only omi_reason_total pending; lane 14 (#22422) removes it when it lands the denominator. Verified: pytest tests/unit/test_monitoring_alert_rule_contract.py, 60 passed (unit). Co-Authored-By: Claude Opus 5.5 <[email protected]>
What
Add the Grafana warning
omi-reason-unknown-ratio, evaluated perfamily. It checks the unknown-to-total reason rate over 30 minutes, requires more than 50 total reason events in that window, and must remain over 2% for 30 minutes. No-data stays OK and execution errors keep the prior state.The ratio stays inline in the alert. The repo has no active custom Grafana recording rules or custom PrometheusRule recording-rule path; kube-prometheus-stack's bundled recording rules remain untouched.
Why
Unknown enum values can hide a bad reason mapping and trigger unnecessary provider routing. The Parakeet
cancelledtoconnection_lostmislabel caused about $75/day of false Soniox routing for five days. The live STT routing runbook and Parakeet reason regression contract document the distinction between owner cancellation and provider failure.The producer counters are planned by legacy-retirement PR #22422 and reach production with M3. They are listed as declared, not observed, metrics until then, so the alert remains quiet while the series are absent.
Verification
backend/.venv/bin/python backend/scripts/provision_monitoring_alerts.py --lintnice -n 10 backend/test.sh; ambient Google credentials were stripped.backend/.venv/bin/python backend/scripts/monitoring_gmp_shadow.py --inventory --output backend/charts/monitoring/gmp-query-migration-inventory.jsonmake preflightRollback
Revert this PR to remove the alert, the pending metric declarations, and the regenerated consumer inventory. No application runtime behavior changes.
Product invariants affected
none
UI-Evidence
none