Repository navigation
Sync: aggregate phase timing and request-bound metrics export - #20659
Merged
Merged
Conversation
…ghtsize # Conflicts: # backend/tests/unit/test_backend_runtime_env_validator.py
…ghtsize # Conflicts: # config/feature-flags.yaml
This was referenced Oct 4, 2026
…ghtsize # Conflicts: # backend/deploy/runtime_env.yaml # backend/deploy/runtime_env/dev.overlay.yaml # backend/deploy/runtime_env/prod.overlay.yaml # backend/tests/unit/test_backend_runtime_env_validator.py
Git-on-my-level
marked this pull request as ready for review
October 4, 2026 20:39
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Adds aggregate sync phase timing and calls-per-attempt for decode/VAD, GCS, Parakeet HTTP attempts, speaker ID and Firestore persistence, and a bounded background Cloud Monitoring export path consumed by the existing Prometheus exporter for both sync services.
The exporter runs in one daemon worker with a one-slot, drop-on-overflow queue; app shutdown closes admission and drains/joins the worker with a hard two-second wait cap; requests never await network or ADC work, with fixed lane/phase labels, platform process identity and a kill switch. Sync decisions, queue limits and CPU billing stay unchanged. Review and dev export/scrape acceptance precede any production rollout. No production writes were made.
Validation: blocked-export request completion, export-disabled, queue overflow and worker failure tests, plus phase/monitoring tests (33) and existing sync router tests (285) passed with the normal CPU guard; deployment-state fixture tests, async blocker scanning, runtime manifest validation, type checking and preflight passed. Live acceptance remains for the coordinator's reviewed deploy.
Cost, request-lifetime audit, headroom evidence, acceptance gates and rollback:
backend/docs/runbooks/sync-cloudrun-rightsizing.md.Failure-Class: none
INV-MEM-4: canonical promotion authority is preserved; lifecycle additions only time existing sync persistence.
Line-Count-Exception: backend/routers/sync.py | 2498 -> 2501 | Add bounded observability hooks at existing operations without changing sync decisions.
Line-Count-Exception: backend/utils/other/storage.py | 1981 -> 1987 | Add bounded observability hooks at existing operations without changing sync decisions.
Line-Count-Exception: backend/utils/stt/pre_recorded.py | 1266 -> 1269 | Add bounded observability hooks at existing operations without changing sync decisions.
Line-Count-Exception: backend/utils/sync/pipeline.py | 3021 -> 3028 | Add bounded observability hooks at existing operations without changing sync decisions.
Round 3 shutdown regression coverage: in-flight plus queued export drain and worker join, idle stop, repeated stop, startup/shutdown race, app shutdown handler, and hung export deadlines (including a requested timeout above the two-second cap).
backend/.venv/bin/python -m pytest backend/tests/unit/test_sync_phase_metrics.py -q: 15 passed.Post-main reconciliation validation:
BACKEND_UNIT_TEST_FILE_LIST=/tmp/omi-20659-r3-test-list.txt bash backend/test.shselected shutdown/metrics and runtime manifest fixtures: 164 passed with the normal CPU guard.bash backend/scripts/typecheck.sh: zero errors. Async blocker scan: zero findings. PR metadata preflight: all four checks passed.