Repository navigation
feat(observability): write-probe kill switch; raise Cloud Run GMP sample cap - #24228
Merged
Merged
Conversation
…ple cap Backend Cloud Run peaked at 9,873 samples per scrape against the shared sidecar cap of 10,000; over the cap GMP drops the whole scrape. Add OMI_FIRESTORE_WRITE_PROBE_ENABLED (on unless literal false) so a service can skip the write probe entirely, and raise the shared sidecar cap to 15,000. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
1 issue found across 5 files
Confidence score: 5/5
backend/docs/feature-flag-registry.mdstill shows an older as-of date, so consumers may not realize the catalog includes the 2026-11-01 flag. Update the snapshot date.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="backend/docs/feature-flag-registry.md">
<violation number="1" location="backend/docs/feature-flag-registry.md:523">
P3: Update the registry’s as-of date when adding this 2026-11-01 flag; otherwise consumers cannot tell that the catalog includes information newer than its stated snapshot.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
| | `OMI_EXTERNAL_LIST_CACHE_ENABLED` | Default on unless false; Encrypted authorized external list responses; ten seconds unless collection write coverage admits a versioned cache; expiry anchored before the origin query | backend | env | open | — | — | — | — | keep | keep | — | dazheng | | ||
| | `OMI_EXTERNAL_LIST_METRICS_ENABLED` | Default on unless false; Count four external list GETs and staged promote POST including auth rate-limit validation and server errors | backend | env | open | — | — | — | — | keep | keep | — | dazheng | | ||
| | `OMI_EXTERNAL_LIST_SINGLE_FLIGHT_ENABLED` | Default on; coalesce simultaneous identical external-list cache misses after each request passes authorization | backend | env | open | — | — | — | — | keep | keep | — | dazheng | | ||
| | `OMI_FIRESTORE_WRITE_PROBE_ENABLED` | Default on; count committed Firestore writes by collection, op, caller and origin at the GAPIC Commit/BatchWrite boundary | backend | env | open | — | — | — | — | keep | keep | — | fswrites | |
There was a problem hiding this comment.
P3: Update the registry’s as-of date when adding this 2026-11-01 flag; otherwise consumers cannot tell that the catalog includes information newer than its stated snapshot.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/docs/feature-flag-registry.md, line 523:
<comment>Update the registry’s as-of date when adding this 2026-11-01 flag; otherwise consumers cannot tell that the catalog includes information newer than its stated snapshot.</comment>
<file context>
@@ -520,6 +520,7 @@ and an explicit empty literal renders as `''`.
| `OMI_EXTERNAL_LIST_CACHE_ENABLED` | Default on unless false; Encrypted authorized external list responses; ten seconds unless collection write coverage admits a versioned cache; expiry anchored before the origin query | backend | env | open | — | — | — | — | keep | keep | — | dazheng |
| `OMI_EXTERNAL_LIST_METRICS_ENABLED` | Default on unless false; Count four external list GETs and staged promote POST including auth rate-limit validation and server errors | backend | env | open | — | — | — | — | keep | keep | — | dazheng |
| `OMI_EXTERNAL_LIST_SINGLE_FLIGHT_ENABLED` | Default on; coalesce simultaneous identical external-list cache misses after each request passes authorization | backend | env | open | — | — | — | — | keep | keep | — | dazheng |
+| `OMI_FIRESTORE_WRITE_PROBE_ENABLED` | Default on; count committed Firestore writes by collection, op, caller and origin at the GAPIC Commit/BatchWrite boundary | backend | env | open | — | — | — | — | keep | keep | — | fswrites |
| `OMI_GEMINI_OVERFLOW_ENABLED` | Enable overflow routing to Gemini | backend, llm-gateway | env | open | — | — | — | — | keep | keep | — | unowned |
| `OMI_LIST_PROJECTION_WRITER_ENABLED` | Default on; atomically maintain compact conversation/action metadata rows and opaque list versions | backend | env | open | — | — | — | — | keep | keep | — | dazheng |
</file context>
Git-on-my-level
added a commit
that referenced
this pull request
Nov 1, 2026
Conflict only in config/feature-flags.yaml with #24228; registry regenerated. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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
Train safety for the GMP sidecar's per-scrape
samplescap (lead ruling 3d124a). Above the cap, GMP drops the instance's whole scrape, not just the new series.Backend Cloud Run max scrape, read-only GMP aggregates (
scrape_samples_scraped, jobomi-cloud-run-application-metrics):The next train adds to backend, beyond the write probe:
That is up to about 118 samples against roughly 127 of headroom.
Two changes:
OMI_FIRESTORE_WRITE_PROBE_ENABLEDkill switch for the feat(observability): count Firestore writes by collection, caller and origin #24218 write probe. It is on unless the literalfalse. Off meansdatabase._clientnever wraps the transport, so no labelled write series exist in that process. That leaves 2 unlabelled counter samples. It is registered inconfig/feature-flags.yamlasops_kill, and the registry doc is re-rendered.backend/deploy/cloud_run_gmp_sidecar.yaml: backend, desktop-backend, notifications-job). Today backend is about 1% from losing all metrics on any new series; this restores headroom. GMP bills per sample emitted, so the cap itself costs nothing. The sync sidecar (cloud_run_gmp_sync.yaml, max 7,704) is unchanged.Series behaviour:
Recommended for the train: merge this. If the cap raise is not wanted in this train, set
OMI_FIRESTORE_WRITE_PROBE_ENABLED=falseon backend Cloud Run only. Sync, listen and pusher keep the probe.Product invariants affected
none. Observability config only; no data path.
Verification
All runs used
backend/test.shunderbin/omi-heavy+nice -n 19, at the unit layer:test_firestore_write_probe.py: 16 passed, including the kill switch (literalfalseandFALSEleaveFirestoreClient.commitunwrapped; unset, empty,true,0,offstay on).test_attach_cloud_run_gmp_sidecar(117),test_external_list_cache,test_fleet_deployment,test_parakeet_request_metrics,test_relevance_metric_is_scraped,test_sync_absorption_metrics. All pass.scripts/check_feature_flag_registry.py: OK.Rollback
Set the switch to
falseon any service, or revert. The cap can return to 10,000 only if the max scrape is well below it.Failure-Class: none
🤖 Generated with Claude Code