Repository navigation
fix(monitoring): stop alert screenshots that stall Grafana - #21389
Merged
Merged
Conversation
Alert screenshot renders call back into Grafana; with slow dashboard queries they timed out (rendering.serverTimeout), held HTTP handlers and made monitor.omi.me flap 502 while rule evaluations failed. Telegram notifications already link the dashboard panel. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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. |
Git-on-my-level
added a commit
that referenced
this pull request
Oct 14, 2026
…rrupted-stream rule Review revision of #21455 round 1: - Prometheus CPU limit back to "2": load is sustained 1.5-2.2 cores over 14h (the ~2.9-core spikes were kubelet scrape-timeout artifacts), 0% CFS-throttled, and the Prometheus-backed rules already time out - the 1600m cap would throttle them and the adapter's HPA metrics further. Starvation is fixed with requests plus the pool resize runbook instead. - Loki read path (ingester/querier 50m/256Mi, index-gateway/ruler 20m/128Mi) gets requests, arithmetic in the values file: jzv7 1913m of 1930m allocatable, mczx 1488m. loki values normalized CRLF->LF (file untouched since #2708; the hygiene check rejects new CRLF lines). - README: rollback now records the pre-apply helm revision (rolling back to rev 14 would revert #21306/#21389/#21358/#21409; #21389 is screenshots-off, the 10-13 502 fix); corrected the "renders with no diff" claim; added the 4-vCPU pool resize runbook (exact gcloud create + cordon/drain, zonal us-central1-a so the Grafana/Prometheus PVCs reattach); stack applies marked off-peak (Prometheus WAL replay of ~700k-980k head series freezes the pusher/listen/parakeet/VAD/diarizer HPAs; #21448's inert diarizer scrape job rides along); the 109/286 down-target count (34 stale kubelet endpoints) noted as operator crash-loop fallout expected to clear. - New metric rule omi-listen-audio-decode-failures shadows the paused corrupted-stream log rule on omi_listen_audio_decode_failures_total (startup zero-init children added); listen-429, ASGI-handshake and direct-OpenAI-quota gaps tracked in #21461.
Git-on-my-level
added a commit
that referenced
this pull request
Oct 14, 2026
…g-node CPU (#21455) * fix(monitoring): hold raw-line Loki alert rules and reserve monitoring-node CPU 2026-10-14 prod: Grafana /api/health flapped 502, alert evaluation logged 190 failures + 120 dropped ticks over 20 minutes, the prometheus operator restarted 48x and the adapter 35x in 31h, and every pusher deploy failed on alert provisioning. Two causes, both read-verified against prod: 1. Four committed alert rules query the Loki datasource for raw log lines (whole-namespace regex scans, 60s ticks, one with [$__auto]). They caused 340 of 410 rule-eval failures in 3h (196 from afd0krbk1bugwf alone), each timing out past the 30s datasource budget - the same failure class as the 2026-10-13 Cloud Logging rule (#21390). Pause all four and hold them in metric-inventory admission_holds; re-admit only on bounded counters. 2. Grafana, the operator and the adapter ran BestEffort on a ~1.93 allocatable-core monitoring node while Prometheus's 2-CPU limit exceeded total node capacity, so Prometheus bursts starved kubelet probes (the operator/adapter restart mechanism - SIGTERM after probe timeout) and Grafana's HTTP server. Cap Prometheus at 1600m and give Grafana, the operator and the adapter explicit requests. New contract test rejects any unpaused rule referencing a log datasource (type or prod Loki UID); README documents the policy. The 2-vCPU monitoring node pool remains undersized for 592k head series - resizing it is the follow-up (owner: infra). * fix(monitoring): Loki read-path requests, metric shadow for paused corrupted-stream rule Review revision of #21455 round 1: - Prometheus CPU limit back to "2": load is sustained 1.5-2.2 cores over 14h (the ~2.9-core spikes were kubelet scrape-timeout artifacts), 0% CFS-throttled, and the Prometheus-backed rules already time out - the 1600m cap would throttle them and the adapter's HPA metrics further. Starvation is fixed with requests plus the pool resize runbook instead. - Loki read path (ingester/querier 50m/256Mi, index-gateway/ruler 20m/128Mi) gets requests, arithmetic in the values file: jzv7 1913m of 1930m allocatable, mczx 1488m. loki values normalized CRLF->LF (file untouched since #2708; the hygiene check rejects new CRLF lines). - README: rollback now records the pre-apply helm revision (rolling back to rev 14 would revert #21306/#21389/#21358/#21409; #21389 is screenshots-off, the 10-13 502 fix); corrected the "renders with no diff" claim; added the 4-vCPU pool resize runbook (exact gcloud create + cordon/drain, zonal us-central1-a so the Grafana/Prometheus PVCs reattach); stack applies marked off-peak (Prometheus WAL replay of ~700k-980k head series freezes the pusher/listen/parakeet/VAD/diarizer HPAs; #21448's inert diarizer scrape job rides along); the 109/286 down-target count (34 stale kubelet endpoints) noted as operator crash-loop fallout expected to clear. - New metric rule omi-listen-audio-decode-failures shadows the paused corrupted-stream log rule on omi_listen_audio_decode_failures_total (startup zero-init children added); listen-429, ASGI-handshake and direct-OpenAI-quota gaps tracked in #21461.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Turn off Grafana unified-alerting screenshots in prod and dev (
[unified_alerting.screenshots] capture = false).Incident, 2026-10-13 ~10:45Z onward:
monitor.omi.me/api/healthflapped between 502 and 200, with some 200s taking 20 s. The Grafana pod stayed up (3/3 Running, 72m CPU, no limits) but was blocked rather than busy. Its log since the 08:35Z restart shows:Failed to evaluate rule;Failed to render imagewithrendering.serverTimeout, all screenshots ofomi-services-overviewpanels for the two firing warnings (Cloud Armordew9b4o7boa2oeand Backend 4XXcew4j7ruiik1sd);http: Handler timeout;context deadline exceeded.The image renderer calls back into Grafana (
callback_urlis the in-cluster Grafana service) to load the dashboard. When Grafana is slow, renders time out while holding Grafana's handlers, which makes it slower still. Meanwhile alert evaluation and the external health check degrade.Telegram notifications already carry the dashboard/panel link (#21365, #21374), so the image adds load without adding signal. The renderer deployment is left in place for manual dashboard renders.
Rollout
After merge: dispatch
gcp_cloud_run_metrics_egress.ymlwithenvironment=prod. That runs Helm, which restarts Grafana, and then the dead-man reconcile. Verify the[unified_alerting.screenshots] capture = falseconfigmap, a stable/api/health, and zero newFailed to render imagelines.Verification
Values-only change.
helm templaterendering of the values is exercised by the existing monitoring contract tests.Product invariants affected
none
Failure class
Failure-Class: new
The new class is a self-referential render loop in the alerting plane: alert screenshot renders call back into the same Grafana, so its own load degrades evaluation and health. The guard is configuration (capture disabled in both environments), and this PR documents it in the monitoring README.
🤖 Generated with Claude Code