Repository navigation
fix(metrics): keep quiet-check counters in both GMP sidecar allowlists - #25033
Merged
Merged
Conversation
listen_quiet_check_arm_total and listen_quiet_check_empty_exit_total predate the omi_ prefix, so both Cloud Run GMP keep rules dropped them at ingestion. The empty-exit counter is born only in the finalization route (backend-sync), so it was never ingested anywhere; the arm counter's Cloud Run copy was dropped the same way. Keep listen_quiet_check_.* explicitly in the shared and sync profiles, declare the empty-exit counter in the metric inventory, and pin both names against both keep rules. The GKE listen/pusher copies are a separate deployment gap: the PodMonitoring targets report up=0 because the GMP collector cannot read metrics-scrape-token. The chart RBAC and backend-secrets copy already exist; the collector needs a restart after they are applied. Deploy steps are in the PR body. Failure-Class: FC-metric-dropped-by-scrape-allowlist Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review Summary: ✅ CompletedThis 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. |
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
The quiet-check counters never reached GMP. Two independent causes, one per
ingestion path:
predate the
omi_prefix, and both keep rules kept onlyomi_.*plus ashort exception list.
listen_quiet_check_empty_exit_totalis born onlyin the finalization route, which runs on backend-sync, so it was never
ingested anywhere.
prod-omi-backend-listen/prod-omi-pusherPodMonitoring targets reportup=0andscrape_samples_scraped=0; the GMP collector's secret watchercannot read
metrics-scrape-token(
watch: unknown (get secrets)). That is a deployment gap, not a code gap,and its fix (fix(metrics): supply GMP scrape token and collector RBAC #24961) was reverted from
mainat8141729fccd9for anunrelated CI hang.
This PR fixes (1) in code and documents (2) as the exact deploy steps below.
Per-counter cause
listen_quiet_check_arm_total{outcome}backend/database/conversation_quiet_checks.py:137(ARM_METRICS[outcome].inc()), children created at import (:32)up=0(collector cannot read the scrape secret). Cloud Run: dropped by the keep rule atbackend/deploy/cloud_run_gmp_sidecar.yaml:19andbackend/deploy/cloud_run_gmp_sync.yaml:48— the name has noomi_prefix.listen_quiet_check_empty_exit_total{disposition,mode}backend/database/conversation_quiet_checks.py:226(EMPTY_OUTCOMES.labels(...).inc()), inside_evaluate_quiet_checkbackend-listen-metricsandpusher-metricsjobsomi_episode_boundary_total{outcome}backend/utils/episodes/metrics.py:366(record_boundary), children primed at import (:272)omi_prefix), so GMP holds only the Cloud Run zero children (namespace=backend180 series,desktop-backend8). The real listen/pusher increments are missing for the same GKE scrape reason as the arm counter.Evidence (read-only, 2026-11-10):
based-hardware:up{job="prod-omi-backend-listen"}= 0 for all 34targets,
scrape_samples_scraped= 0; same forprod-omi-pusher(23targets).
omi_episode_boundary_totalexists only underjob="omi-cloud-run-application-metrics".prod-omi-gke:listen_quiet_check_arm_totalhas 140series on
backend-listen-metricsand 92 onpusher-metrics;omi_episode_boundary_totalhas 700 / 460;listen_quiet_check_empty_exit_totalhas none — the evaluate path never runs in a listen/pusher process.
{"component":"secret manager","err":"watch: unknown (get secrets)","msg":"secret watcher failed to start","name":"metrics-scrape-token", "namespace":"prod-omi-backend"}. The live prod Role/RoleBinding and themetrics-scrape-tokenExternalSecret were applied at 09:07Z today, but nocollector has restarted since, and the source change (fix(metrics): supply GMP scrape token and collector RBAC #24961) is no longer on
main.based-hardware-dev:up{job="dev-omi-backend-listen"}= 0 andup{job="dev-omi-pusher"}= 0; dev has the PodMonitoring but no*-metrics-scrapeRole/RoleBinding at all.Fix
backend/deploy/cloud_run_gmp_sidecar.yamlandbackend/deploy/cloud_run_gmp_sync.yaml: keeplisten_quiet_check_.*explicitly. Names are unchanged, so the in-cluster series the quiet-exit
rollout is judged on keep their continuity.
backend/charts/monitoring/metric-inventory.prod.json: declarelisten_quiet_check_empty_exit_total(source-backed, not yet in thesnapshot).
backend/tests/unit/test_quiet_check_metrics_are_scraped.py: pins bothcounter names against both keep rules and asserts the module registers them.
backend/tests/unit/test_attach_cloud_run_gmp_sidecar.py: updates the pinnedshared-regex contract.
.github/failure-classes/FC-metric-dropped-by-scrape-allowlist.json: adds thenew test as a guard artifact.
backend/docs/listen_pusher_pipeline/changes/.Tests
Result: 429 passed (247 + 182 across the two runs), 0 failed.
Deploy steps (cl2-deploy)
Repository changes alone do not mutate Cloud Run or GKE.
(
OMI_GMP_RUN_MONITORING_CONFIG), so it ships with the next normal deploy ofeach service. Dev first, then prod:
gh workflow run gcp_backend_auto_dev.yml --ref main(backend + backend-syncpromotion; the deploy helper validates the config locally.
8141729fccd9). Until it re-lands, the listen/pusher PodMonitoring targetsstay
up=0and no GKE-sourced counter can reach GMP. The live prod clusteralready has the Role/RoleBinding and the
metrics-scrape-tokensecret fromthe 09:07Z apply; dev has neither.
scrape_samples_scraped.Confirming one series in dev after deploy
With
QUIET_EMPTY_EXIT_ENABLED=trueon dev listen and the dev Cloud Runservices:
A single non-zero
listen_quiet_check_empty_exit_total{disposition="delete_empty",mode="serve"}series is the acceptance signal for the quiet-exit rollout.
Failure-Class: FC-metric-dropped-by-scrape-allowlist
🤖 Generated with Claude Code