Repository navigation
feat(relay): log metric and console alert for unreadable cell switch files (evidence code) - #27024
Conversation
…files (evidence code)
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe change adds a GCE logging metric for unreadable relay control flags, with cell and failure-category labels. A console-only alert triggers when the metric’s per-cell sum exceeds zero. Tests check the event and metric configuration, along with the alert threshold, channels, metric type, and grouping. The relay fixture includes the new metric and alert, and the pretest command runs the new test. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to This change only adds a console-only monitoring metric and alert for unreadable relay switch files, plus matching tests. It does not affect relay runtime behavior, and nothing changes in production until the documented targeted apply is run. No merge-blocking risk remains. Pre-merge checks |
|
Rebased onto main as one commit after its parent squash-merged; kept both sides of the add/add list conflicts with #27024.
Rebased onto main as one commit after its parent squash-merged; kept both sides of the add/add list conflicts with #27024.
Evidence code: this changes
cloud/infra/terraform/relay-observability.tf, which is in the relay evidence-code set (relay-evidence-code-provenance.mjs). Merge between rolls, never during a wave: a merge changes the evidence a running monitor was sealed against.ELI5
Each relay cell reads a small switch file from Cloud Storage every 5 seconds. When that read starts failing, the cell writes one log line and keeps its last switches. Nobody sees that line today. This PR counts it and shows an alert in the monitoring console. Nothing is created until someone runs the targeted apply below.
What Changed
orca_relay_control_flags_unreadable(GCE cells only), counting theorca_relay_control_flags_unreadableline fromrelay-control-flag-channel.ts, labelled bycell_id(taken from the line'sobject,cells/<cell>.json) andfailure(metadata,not-found,http,network,malformed,void).Orca Relay: cell cannot read its switch file, console only (notification_channels = []) until the step-3/5 roll finishes: any line on a cell in a 5-minute window, one series per cell.relay-control-flag-alerts.test.mjspins the event name, theobject/failurefields and the object-name shape on the relay side against the metric, plus the alert's threshold and console-only routing. The two resources are added to the root-partition fixture.Before: a cell that can't read its switch file, or that rejects a bad file, shows up only in raw logs. After apply: it's charted per cell and failure cause, and opens a console incident.
Why
Threshold: any line (> 0). The reader logs once per change of cause, not once per failed poll, and logs nothing on recovery. A cell stuck failing writes exactly one line, so any bar above zero would miss the case that matters most. For the same reason the incident closing doesn't mean the cell recovered; the alert docs say to compare the object's generation with the cell's last
orca_relay_cell_flags_appliedline.Why console only for now: one storage 5xx or a network blip on one cell also writes a line. Staging measured on 2026-10-09 (18:25–19:23Z, three cells): 6 lines, 5
not-foundfrom boots before any object was written and 1networkonstaging-gce-c3. That's fine to see in the console but too noisy to page on before every production cell has an object. Paging can be turned on after the roll, once all-off objects exist for every cell. At that pointnot-foundandvoidmean real operator or IAM faults.Why a separate metric and not an entry in
relay_incident_metrics: that map has no labels. Here the cell and the failure cause are what tell a one-cell blip (ignore it) apart from a bucket or IAM fault (every cell at once) or a bad object (void). Staging confirms that theconsole.warnJSON oncos_containersis parsed intojsonPayloadwith these exact fields.How to apply (targeted only; never a root plan)
Apply after #26835 (bucket and IAM) and after an all-off object exists for every production cell. Before that, every cell logs
not-foundonce per boot. Fromcloud/infra/terraform, production credentials:Go:
2 to add, 0 to change, 0 to destroy. Anything else means stop.Linked Issue
N/A (internal relay redesign; step-3/5 pre-roll observability).
Visual Proof
N/A: monitoring declarations only.
Testing
terraform fmt -checkandterraform validatepass.node --test dev/scripts/relay-control-flag-alerts.test.mjs dev/scripts/relay-db-fault-alerts.test.mjs dev/scripts/terraform-root-partition.test.mjs: 13 pass.Targeted
terraform plan -lock=false(no-out, no apply) against production state on 2026-10-09:Plan: 2 to add, 0 to change, 0 to destroy(the metric and the policy).I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Agent skill upstream boundary
Notes
Don't merge outside the between-rolls window, and don't apply without the owner's go.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)