Repository navigation
fix(monitoring): rename custom-metric API aggregates back to their plain omi_ names - #21409
Merged
Merged
Conversation
…ain omi_ names backend-sync's omi_sync_phase_* histograms arrive as stackdriver_generic_task_custom_googleapis_com_<name>, which the existing rewrite does not match, so omi-cloud-run-metric-names-unnormalized has been pending at critical and the inventory recorded the mangled names. 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
omi-cloud-run-metric-names-unnormalized(critical) has been pending and firing on prod since this morning. It counts 390 series: backend-sync'somi_sync_phase_calls_per_job_*andomi_sync_phase_duration_seconds_*histograms (exported since 0aa2513, 2026-10-04).The cause is that these series are written through the Cloud Monitoring custom-metric API. The Stackdriver exporter names them
stackdriver_generic_task_custom_googleapis_com_<name>, with no value-type suffix, and the existing rewrite only matchesstackdriver_prometheus_target_prometheus_googleapis_com_*. So the alert is a true positive: the series are ingested but sit outside the plainomi_namespace that dashboards query. The metric inventory had also recorded the mangled names.metric_relabel_configsrewrite in dev and prod forstackdriver_generic_task_custom_googleapis_com_(omi_.+)→${1}.test_custom_metric_api_aggregates_are_renamed_back_too. It checks the rewrite in both environments, the name recovery, and that no inventoried metric still matches the alert'sstackdriver_.*_omi_.*pattern.Verification
count by (__name__)({job="cloud-run-application-metrics", __name__=~"stackdriver_.*_omi_.*"})returns exactly those six families (165+15+15 series each).backend/test.shwith everytests/unit/test_monitoring*.py: pass.alert_backtest.py --lint:failures: {}.Rollout
Monitoring Helm rollout (
gcp_cloud_run_metrics_egress.yml, prod). Then confirm the unnormalized count is 0 and thatomi_sync_phase_duration_seconds_count{service_name="backend-sync"}exists.Failure-Class: none
🤖 Generated with Claude Code