Repository navigation
SCA-4753: Measure offline sync backlog by build (Phase 0) - #26474
Merged
Merged
Conversation
…-sol/35aaa613eee2
Git-on-my-level
added a commit
that referenced
this pull request
Nov 27, 2026
## What changed and why Regenerated the GMP query migration inventory after #26474 added the Omi Core Features upload panels. The stale generated file fails the Backend Unit Tests on main and also blocks #26306. Tracked in SCA-4753. ## Product invariants affected none ## How it was verified - Ran `python3 backend/scripts/monitoring_gmp_shadow.py --inventory --output backend/charts/monitoring/gmp-query-migration-inventory.json`. Compared the generated entries with the dashboard at the #26474 merge. Only the four query consumers for panels 101, 102, and 103 and the total (326 to 330) changed. - Ran the 35 tests in `backend/tests/unit/test_monitoring_gmp_shadow.py` with the local test environment and with pytest on Python 3.11. Both runs passed. - Ran `make preflight` and validated the PR metadata. The shallow checkout skips the history-dependent failure-class ratchet. ## Tests The existing `test_committed_inventory_is_current` compares the committed file with the generator output and covers this repair. UI-Evidence: none -- generated inventory only Failure-Class: none <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/26517?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a> <a href="https://www.cubic.dev/action/auto-fix/pr/BasedHardware/omi/26517?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F26517&source=description" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img alt="Turn on auto-fix" src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
Git-on-my-level
added a commit
that referenced
this pull request
Nov 29, 2026
…26689) ## What changed and why SCA-4753 prerequisite for the fleet backlog pilot (#26677). Two backend-only changes. **1. Backend GMP sample cap 15,000 → 25,000** (`backend/deploy/cloud_run_gmp_sidecar.yaml`). Backend Cloud Run peaked at **14,397** post-relabel samples per instance on 2026-11-28 (ro-prod GMP, `max_over_time(scrape_samples_post_metric_relabeling{namespace="backend"}[1d])`). Over the limit GMP drops the instance's **whole** scrape, so every backend metric goes dark for that instance. #26677 raises the fleet exporter's worst case from 3,842 to 8,218 samples (+4,376), which would put a busy instance over 15,000. Ingestion is billed per sample emitted, not by this ceiling; the change only moves the drop point. The sync profile (`cloud_run_gmp_sync.yaml`, peak 5,346) stays at 15,000. **2. Phase 0 upload-trace build bands by floor** (`backend/utils/sync/capture_end.py`, `backend/utils/product_metrics.py`). The #26474 allowlist (1367, 1504, 1514, 1515, 1516, 1520) matched none of the builds phones sent on 2026-11-28 (ro-prod GMP `omi_listen_accepted_total` by `app_build`: iOS 1597–1650, Android 1500 and 1651), so the "Upload age over 6 h by build" panel shows only `older`. `release_build_band` keeps an exact build at or above a per-platform floor (iOS 1620, Android 1500) until a process has seen 8 exact builds, then `other`; below the floor `older`; otherwise `unknown`. A stale floor degrades to `other`, never to a list that matches nothing. Label set unchanged (`age`, `platform`, `build_band`); worst case 2 × 3 × 11 = 66 series per target. **Order:** this must be serving on backend before #26677's `sync-backlog-fleet-snapshot` flag is turned on. **Rollback:** revert this PR. Both changes are config/label-only; no data path, Firestore, or client change. ## Verification - m1 lane worktree via `omi-heavy`, `bash backend/test.sh` one process per file: `test_product_metrics.py` (new `test_release_build_band_floors_cap_and_unknowns`), `test_sync_capture_end.py`, `test_firestore_attribution_export.py` (cap pinned per profile), `test_desktop_message_quota_router.py`, `test_attach_cloud_run_gmp_sidecar.py`, `test_fleet_deployment.py`, `test_monitoring_telemetry_contract.py`, and the chat-router harness users: 15 files, all passed. - CI's changed-file selection is 2,246 files (`product_metrics` is widely imported); that full run is CI's. - Not yet measured: per-instance scrape size after the pilot flag; that is the SCA-4753 pilot readback. UI-Evidence: none -- backend config and metric labels only 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/26689?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a> <a href="https://www.cubic.dev/action/auto-fix/pr/BasedHardware/omi/26689?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F26689&source=description" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img alt="Turn on auto-fix" src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
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.
What changed and why
Add an Offline sync backlog row to Omi Core Features. The failed upload, backend-sync revision-wide HTTP 503, and upload age panels use request or attempt counts. The v2 handler counts valid upload traces by platform, bounded release build, and whether the oldest recording was sealed more than six hours ago. Upload age buckets extend to seven days. Part of SCA-4753.
The merge with main preserves SCA-4464’s retirement of the poll-backoff experiment. It drops the settlement cohort panel and histogram expansion because the metric producer was removed. The refusal and upload-age queries are unchanged by the repair.
Product invariants affected
none
How it was verified
Tests
backend/tests/unit/test_sync_capture_end.pycovers the exact six-hour boundary, bounded build/platform labels, and rejection of invalid traces.UI evidence
UI-Evidence: none -- Internal Grafana dashboard, with production screenshot due in the serving readback.
Failure class (fixes)
Failure-Class: none
Line-Count-Exception: backend/routers/sync.py | 4399 -> 4406 | Pass the existing client headers to the upload trace observer at the pre-admission call site.