Skip to content

monitoring: alert on unknown reason-enum ratio - #22446

Merged
Git-on-my-level merged 1 commit into
BasedHardware:mainfrom
Git-on-my-level:lane/reason-unknown-alert-1019
Oct 19, 2026
Merged

Git-on-my-level merged 1 commit into
BasedHardware:mainfrom
Git-on-my-level:lane/reason-unknown-alert-1019

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

What

Add the Grafana warning omi-reason-unknown-ratio, evaluated per family. 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 cancelled to connection_lost mislabel 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 --lint
  • 19 monitoring and alert-provisioning unit-test files via nice -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.json
  • make preflight

Rollback

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

View guided diff

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T07:54:54.573506Z b8bfb72 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@Git-on-my-level
Git-on-my-level merged commit 1722ac2 into BasedHardware:main Oct 19, 2026
52 checks passed
Git-on-my-level added a commit that referenced this pull request Oct 19, 2026
…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]>
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