Skip to content

fix(monitoring): admit seven held alerts from prod replay evidence - #21386

Merged
Git-on-my-level merged 2 commits into
mainfrom
lane/obs-holds
Oct 13, 2026
Merged

Git-on-my-level merged 2 commits into
mainfrom
lane/obs-holds

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

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.

Rule Decision Evidence
omi-llm-gateway-lane-failure-ratio Admit 10 episodes in 10 days, all real: gemini-embeddings provider_failure (~1.7k/h) and proactive-notification upstream invalid_request, 10-04 to 10-09. None since the 10-09 08:20Z gateway fixes.
omi-journey-live-transcription-fail Admit 1 episode in 10 days (10-08 23:38 to 10-09 00:03 at 5-minute steps).
omi-llm-gateway-invalid-requests Admit Gateway prod deploy 38378781296 (0148427) initialized llm_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-dead Fix + admit to_mode="unavailable" (no provider left) breached on every evaluation of every replayed day, because it can never record recovered. It is now excluded, as are retired providers (omi_stt_provider_retired == 1, today Deepgram), using the same exclusion as omi-stt-provider-budget. Corrected-rule replay at 30-minute steps over 10 days: one real episode, to_mode=parakeet 10-06 13:43 to 10-07 04:13 (Parakeet exhausting on capacity_full with ~0 recovered during the L4 stockout), plus two single samples. Nothing since.
omi-llm-gateway-client-reachability Reduce + admit llm_gateway_chat_extraction_requests_total and llm_gateway_client_first_byte_seconds had zero prod series for 10 days: the main gateway call path never records them. Only llm_gateway_circuit_open is initialized (backend-listen, pusher and gateway pods; 10-day max 0), so the rule is now `max(llm_gateway_circuit_open{job=~"backend-listen-metrics
omi-daily-recap-generation-failing Admit Cloud Monitoring timeSeries.list replay: 4 generation failures in 10 days, no trailing-3h window above 24.
omi-sync-intake-fragmented Admit 40 sampled 30-minute Cloud Logging windows across 10 days. Created/(created+merged) peaked at 0.50, as an upper bound because merges were capped at the 1,000-line read limit; the threshold is 0.80.
omi-queue-oldest-ready Still held sample_unknown=1 on every publisher for memory_outbox (230,082 pending, no prod consumer), vector_repair_outbox, and candidate_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/*.json and alert-rules.json stay 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.sh with BACKEND_UNIT_TEST_FILE_LIST = every tests/unit/test_monitoring*.py: all passed.
  • Edited expressions evaluated against prod Prometheus: fallback-leg attempts now return modulate/parakeet/soniox only; client-reachability returns 0.
  • Grok review: three findings (NoData/masking on client-reachability, retired Deepgram leg, stale debt pin), all fixed in the second commit.
  • After merge, the supervisor PUTs the seven rules live from the committed JSON and confirms the fleet verifier shows 0 divergent.

Product invariants affected

none

Failure class

Failure-Class: FC-alert-never-provably-fired

🤖 Generated with Claude Code

View guided diff Turn on auto-fix

Git-on-my-level and others added 2 commits October 13, 2026 17:23
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]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 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-13T11:13:31.994263Z 82cb385 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.

@Git-on-my-level
Git-on-my-level merged commit 6c69a6c into main Oct 13, 2026
62 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/obs-holds branch October 13, 2026 11:04

@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: 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",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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,

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

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