Repository navigation
fix(monitoring): admit seven held alerts from prod replay evidence - #21386
Conversation
Unpause lane-failure-ratio, live-transcription-fail, invalid-requests, daily-recap generation, sync-intake fragmentation, fallback-leg-dead and client-reachability after replaying each against prod history. - fallback-leg-dead: exclude to_mode="unavailable"; the no-provider-left sentinel can never recover and breached on every evaluation. - client-reachability: keep only the initialized circuit-open arm; the extraction and first-byte families had zero prod series for 10 days. - queue-oldest-ready stays held with the measured backlog reason. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review follow-ups: restrict the circuit-open rule to client jobs so the gateway's permanent 0 cannot mask an open client circuit, exclude retired providers from fallback-leg-dead like the budget rule does, and drop the stale legacy-debt pin for client-reachability. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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: 82cb385439
ℹ️ 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".
| "uid": "prometheus" | ||
| }, | ||
| "expr": "(sum(rate(llm_gateway_chat_extraction_requests_total{mode=\"fallback\"}[15m])) / clamp_min(sum(rate(llm_gateway_chat_extraction_requests_total{mode=~\"serving|fallback\"}[15m])), 1e-9) > bool 0.05) or (max(llm_gateway_circuit_open) > bool 0) or ((sum(increase(llm_gateway_chat_extraction_requests_total{mode=~\"serving|fallback\"}[15m])) >= bool 10) and (sum(increase(llm_gateway_chat_extraction_requests_total{mode=\"serving\",outcome=\"success\"}[15m])) == bool 0)) or (histogram_quantile(0.95, sum(rate(llm_gateway_client_first_byte_seconds_bucket[5m])) by (le)) > bool 5)", | ||
| "expr": "max(llm_gateway_circuit_open{job=~\"backend-listen-metrics|pusher-metrics\"}) > bool 0", |
There was a problem hiding this comment.
Match the alert window to the circuit cooldown
When the gateway remains unreachable while client traffic continues, this gauge is not continuously open for the rule's 5-minute pending period: GatewayCircuitBreaker defaults to a 30-second cooldown, and the first request after that cooldown clears llm_gateway_circuit_open before probing the gateway (gateway_resilience.py:84-106). With moderate traffic, repeated probe failures therefore alternate the gauge between 0 and 1 and reset Grafana's pending state, so the newly enabled reachability alert can miss the sustained transport outage it is intended to detect. Use a failure/fallback counter or a time-windowed signal, or make the pending duration compatible with the breaker lifecycle.
Useful? React with 👍 / 👎.
| "impact": "product" | ||
| }, | ||
| "isPaused": true, | ||
| "isPaused": false, |
There was a problem hiding this comment.
Exclude client cancellations from lane failures
When at least 20 requests reach a lane and more than 25% of clients cancel or abandon their streams, enabling this rule produces a critical lane-failure alert even if the provider is healthy. The numerator uses outcome!="success", while the gateway explicitly records client disconnects and abandoned stream consumers as outcome="cancelled" (openai_compatible.py:158-175 and 733-773). Restrict the numerator to actual error outcomes, or otherwise exclude cancelled, before activating this as a provider/lane health signal.
Useful? React with 👍 / 👎.
| "instatus_component": "speech-processing" | ||
| }, | ||
| "isPaused": true, | ||
| "isPaused": false, |
There was a problem hiding this comment.
Count fresh-service conversation creations
When fragmentation occurs in the fresh sync lane, this newly enabled alert omits every outcome=created event emitted by backend-sync, because query A pins creations to backend-sync-backfill even though query B counts merges from both services. The v2 endpoint allows uploads without a target conversation, and the shared sync pipeline records created whenever assign_sync_conversation creates one, regardless of lane; the zero fresh creations seen in one historical sample are therefore not an emitter invariant. Include backend-sync in the creation query so a fresh-lane per-chunk storm cannot be diluted into a healthy ratio.
AGENTS.md reference: backend/AGENTS.md:L145-L145
Useful? React with 👍 / 👎.
| "instatus_component": "speech-processing" | ||
| }, | ||
| "isPaused": true, | ||
| "isPaused": false, |
There was a problem hiding this comment.
Use an alert-capable data source for sync intake
Unpausing this rule cannot produce a working alert because both inputs are raw queries against googlecloud-logging-datasource, whose official documentation states that Grafana Alerting is not supported and recommends querying log-based metrics through Cloud Monitoring instead. Since this rule also sets execErrState to OK, evaluator failures are silently treated as healthy, so the production fragmentation condition will never notify regardless of the replayed log counts. Create the corresponding log-based metrics and query them through the Stackdriver/Cloud Monitoring data source before enabling the rule.
Useful? React with 👍 / 👎.
Summary
Admit seven of the eight alerts that #21366 left paused behind admission holds. Each decision comes from a replay against prod history (read-only, ro-prod), not from the rule's own claims. Two of the rules needed a fix before they could be admitted.
omi-llm-gateway-lane-failure-ratioprovider_failure(~1.7k/h) and proactive-notification upstreaminvalid_request, 10-04 to 10-09. None since the 10-09 08:20Z gateway fixes.omi-journey-live-transcription-failomi-llm-gateway-invalid-requestsllm_gateway_request_rejections_total{error_class="invalid_request"}at 0 on all four surfaces. 0 pre-route invalid_request rejections in 10 days.omi-stt-fallback-leg-deadto_mode="unavailable"(no provider left) breached on every evaluation of every replayed day, because it can never recordrecovered. It is now excluded, as are retired providers (omi_stt_provider_retired == 1, today Deepgram), using the same exclusion asomi-stt-provider-budget. Corrected-rule replay at 30-minute steps over 10 days: one real episode,to_mode=parakeet10-06 13:43 to 10-07 04:13 (Parakeet exhausting oncapacity_fullwith ~0 recovered during the L4 stockout), plus two single samples. Nothing since.omi-llm-gateway-client-reachabilityllm_gateway_chat_extraction_requests_totalandllm_gateway_client_first_byte_secondshad zero prod series for 10 days: the main gateway call path never records them. Onlyllm_gateway_circuit_openis initialized (backend-listen, pusher and gateway pods; 10-day max 0), so the rule is now `max(llm_gateway_circuit_open{job=~"backend-listen-metricsomi-daily-recap-generation-failingtimeSeries.listreplay: 4 generation failures in 10 days, no trailing-3h window above 24.omi-sync-intake-fragmentedomi-queue-oldest-readysample_unknown=1on every publisher formemory_outbox(230,082 pending, no prod consumer),vector_repair_outbox, andcandidate_integration_outbox(3,287 failed, no retry worker), because each backlog exceeds the 1,000-row scan cap. The hold reason now states this. Follow-ups: integrations retry sweeper (separate PR) and a memory_outbox consumer plus ordered age sampler (separate task).Edits are text replacements scoped to each rule object, so
alerts/*.jsonandalert-rules.jsonstay byte-identical per UID.Verification
python3 backend/scripts/alert_backtest.py --lint: 0 failures, 5 legacy debt (client-reachability no longer has lint debt, so its stale pin is removed).backend/test.shwithBACKEND_UNIT_TEST_FILE_LIST= everytests/unit/test_monitoring*.py: all passed.Product invariants affected
none
Failure class
Failure-Class: FC-alert-never-provably-fired
🤖 Generated with Claude Code