Repository navigation
perf(metrics): collect production serving bulk metrics every 120s - #25777
Merged
Merged
Conversation
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.
Failure-Class: none
Change
Production billed Prometheus samples fell from 2.277B ($122.93, Nov 16 UTC) to 1.324B ($71.48, Nov 18 UTC transition day) as #25563 rolled out. The corresponding totals across production and development were $124.96 and $75.08. Leave the existing production PodMonitoring split in place and move the two existing GMP bulk jobs from 60s to 120s. Local Prometheus and primary GMP jobs remain at 15s. Backend Cloud Run sidecars stay at their observed 60s cadence. This change does not touch other collectors. The separate desktop-backend sidecar showed an effective 30s cadence. Both Firestore attribution labels and every metric family, label, job identity and histogram bucket are retained. The prod Helm value
podMonitoring.bulkIntervaldefaults to120sand60sis the kill switch.DESIGN: Not required. Only collector cadence changes. Source and live query audit found no affected alert or dashboard input.
Readback and estimate
Pusher split by the start of Nov 18 UTC and listen joined by 08:00 UTC. The 24h window ending Nov 19 at 10:26 UTC is wholly after the split and has 1.172B collected samples across GKE and Cloud Run. The Nov 19 10:18 UTC GKE census identified 44 high-volume scalar families exclusive to the two bulk jobs (215,987 live series). They accounted for 330.65M attributed samples in that 24h window. Halving their cadence projects 165.33M fewer samples/day and $8.93/day at the observed $0.054/M. The model projects 1.007B samples/day and $54.36/day overall, $68.57 below Nov 16 in production. Attribution is a billing proxy and the estimate depends on target counts, workload and the rate. The current scalar series count alone projects $8.40/day of additional savings. Use complete settled UTC billing days to verify the $60/day target.
Use
sum by (metric_type)(increase(monitoring_googleapis_com:collection_attribution_write_sample_count{attribution_dimension="cluster",attribution_id="prod-omi-gke",metric_type=~"prometheus.googleapis.com/(omi_(fallback_total|stt_cost_routing_(ignored_deaths|settlements)_total|firestore_billed_reads(_by_caller|_by_origin)?_total)/counter|omi_episode_compose_seconds/histogram)"}[24h])), evaluated at the following UTC midnight. Repeat withattribution_id="__run__"as the Cloud Run comparison. The billing export has the total SKU rather than the per-family breakout. Use project.id='based-hardware' to match the PromQL scope. Use the billing SQL and rollout/rollback steps in the runbook.Verification
Audit used ro-prod for GCP and a read-only Grafana credential. Checked source alerts and dashboards, 37 live Cloud Monitoring policies, one Cloud Monitoring dashboard, 269 Grafana rules and 50 Grafana dashboards. Local fallback/STT alerts and resilience dashboards use the in-cluster datasource. The GMP Firestore paging rules use caller/overflow/completed-audio inputs on the existing 15s jobs. No live managed Rules, ClusterRules or GlobalRules were present. Ad-hoc bulk queries should use a window of at least 8m for rate/increase. Release can patch just the two existing bulk PodMonitoring intervals and restore the prior 60s values on rollback. This needs no pod roll.