Skip to content

perf(monitoring): cut sync GMP sidecar allocation and ingestion - #22089

Merged
Git-on-my-level merged 2 commits into
mainfrom
lane/sol-gmp-shrink
Oct 18, 2026
Merged

Git-on-my-level merged 2 commits into
mainfrom
lane/sol-gmp-shrink

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

Sync/backfill/integration currently reserve a 1-vCPU/512Mi GMP collector per instance and ingest the full backend registry every 30s. This reduces only those three collectors to 0.08 vCPU / 128Mi, uses a separate 60s RunMonitoring config/secret, and filters metrics to checked consumers. The RunMonitoring name and native GMP job label remain omi-cloud-run-application-metrics for existing direct-query selectors. App resources and cpu-throttling=false remain unchanged; the shared backend/listen config stays broad at 30s.

The allowlist preserves the dev/prod sync exporter's families, sync/summary/storage fallbacks, and direct sentinel batch-pipeline, accept-to-summary histogram, summary-terminal/debt and live-transcript-outcome metrics. Current fleet_gate/david_gate use durable state, projection logs and native Cloud Run request metrics, which are unaffected.

Conservative modeled gross savings: prod ~$107/day at Oct-16 population, ~$152/day at Oct-17 run rate; dev ~$16/day and ~$12/day respectively. These combine allocated compute reductions and seven measured dropped families; the 60s interval and live-STT fallback filtering add savings not priced here. Constant population and prior blended rates assumed; autoscaling/CUD allocation can change realized savings. Nothing has been deployed.

Validation:

  • nice -n 19 .../python -m pytest -q backend/tests/unit/test_attach_cloud_run_gmp_sidecar.py backend/tests/unit/test_fleet_deployment.py: 84 passed, through omi-heavy.
  • Rendered helper YAML passed nice -n 19 gcloud run services replace --dry-run (subprocesses inherit niceness) against all three dev services, with unchanged application limits and traffic. Full exported services were identical before/after. Existing config bindings were retained for these resource probes; no secret write or payload read.
  • CPU 0.08/0.1/0.25 with 128Mi passed. 0.079 vCPU and 64Mi rejected, establishing the accepted minimum. The unchanged 2-vCPU app plus collector totals 2.08 vCPU with gen2/concurrency 20/instance billing.
  • CPU limits document the minimum and restrictions for fractional instances; multi-container allocation is the sum of container limits. Dev dry-run confirms this particular fractional total is accepted.

Control-plane validation does not prove runtime scrape/load health at the smaller envelope. Before production promotion, check collector readiness, memory/OOM/restarts and fresh retained samples under load. The steady scrape interval adds up to 30s delay. Cloud tier: dev-operator for dry-run validation, ro-dev for aggregate sample reads; no deployed revision or traffic changes.

Rollback: restore prior traffic-selected revisions (numeric config versions are pinned), then revert this PR before the next deployment. That restores 1 vCPU/512Mi and the broad 30s config without changing billing mode. Do not merge as part of this task.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T04:52:24.026394Z 1ac9365 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1ac936557c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread backend/deploy/cloud_run_gmp_sync.yaml Outdated
apiVersion: monitoring.googleapis.com/v1beta
kind: RunMonitoring
metadata:
name: omi-cloud-run-sync-metrics

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the native GMP job label

When these three services adopt this config, changing the RunMonitoring name also changes their native GMP job label to omi-cloud-run-sync-metrics, but the checked-in direct GMP queries still select job="omi-cloud-run-application-metrics"—including sync-only mappings such as omi_sync_dispatch_attempts_total and omi_sync_intake_total in backend/charts/monitoring/gmp-shadow-mappings.json. After deployment, monitoring_gmp_shadow.py will therefore report those comparisons as unproven, while shared-family comparisons can use only non-sync producers and produce misleading results. Keep the existing monitoring name or update every direct GMP consumer to include the new job label.

Useful? React with 👍 / 👎.

@Git-on-my-level
Git-on-my-level merged commit 26c4c39 into main Oct 18, 2026
56 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/sol-gmp-shrink branch October 18, 2026 05:30
Git-on-my-level added a commit that referenced this pull request Oct 18, 2026
Git-on-my-level added a commit that referenced this pull request Oct 18, 2026
* Revert "perf(monitoring): cut sync GMP sidecar allocation and ingestion (#22089)"

This reverts commit 26c4c39.

* fix(deploy): re-land cheap GMP collectors with pinned existing-secret versions

* fix(deploy): use revision-local env for public GMP collector config

* test(deploy): attach revision-local configs with Secret Manager denied

* chore(deploy): scope failure-class update to prevention artifacts

* fix(deploy): keep secret metadata out of preflight logs

* fix(deploy): normalize retained application secret annotations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant