Repository navigation
sre: exclude probe routes from 5xx gate, surface SRE report, stop asking questions in CI - #474
Merged
Merged
Conversation
…ing questions in CI verify-deploy.sh's 5xx gate was tripping on expected /ready 503s during DB blips (2026-09-08 coupon-bot false-fail); exclude http_route!~"/ready|/healthz" and print the raw value with a note. _sre-agent.yml now captures the codex report to a file, uploads it as an artifact, and posts it to the job summary, so it's visible without opening raw logs. sre.md gets a non-interactive-run rule (never end on a question in unattended CI), corrects the Step 1 claim that the 5xx rate is "structurally always zero" (it isn't — readiness 503s + the 2-replica/no-per-pod-label scrape collision produce phantom non-zero rates, per the 2026-09-08 incident), and requires Step 4 root-cause reports to cite the metric's actual value/series/since-when instead of "transient race". Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DzfsFzcMzXbJNiLthAfUQg
Failure-class note, Step 2 Loki-marker note, and Reference/Key-Metrics closing note all still said 5xx is structurally always 0; point each at the Step 1 raw-counter/phantom-rate explanation instead. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DzfsFzcMzXbJNiLthAfUQg
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
scripts/verify-deploy.sh: exclude/ready//healthzfrom the 5xx gate PromQL selector; readiness 503s during a DB blip are expected and already covered by Phase 2. FAILED log line and the FAILED summary bullet now print the raw value plus "(probe routes excluded)"..github/workflows/_sre-agent.yml: the codex step now writesoutput-file: /tmp/codex-output/sre-report.md(id: run-agent); a newif: always()step uploads/tmp/codex-output/as artifactsre-report-${{ inputs.bot }}(14-day retention, ignore-if-missing), mirroringmonitor.yml; a newif: always()step appends the report (or a fallback line if the agent step failed/was cancelled) to$GITHUB_STEP_SUMMARYunder## SRE agent report — ${{ inputs.bot }}. Both new steps run before the existing "Re-enable ArgoCD auto-sync" safety net, which (with "Disconnect VPN") stays last..github/prompts/sre.md: added a "Non-interactive run" rule (never end on a question/offer/menu in unattended CI — execute via Path A or file an issue via Path B, final message is the finished Step-7-style report); corrected the Step 1 claim that the 5xx rate is "structurally always zero" (it isn't —/ready503s by design on DB-ping failure, and with 2 replicas + no per-pod scrape label,rate()/increase()on any counter for that job can report a constant phantom rate off frozen counters; 2026-09-08 worked example +changes()/resets()diagnostic included); added a Step 4 rule that a metric-threshold failure's root cause must cite the metric's actual value/series/since-when, not just "transient race".Context
Incident 2026-09-08:
verify-deploy.shfailed a coupon-bot deploy on5xx_rate=0.63. Root cause (proven from Prometheus): shared Postgres restart caused ~2 min of expected/ready503s on both coupon-bot and vahter-bot; those counters froze but 2-replica/no-per-pod-label scrape collision maderate()report a constant phantom non-zero rate for 9 hours afterward. The deploy itself was fine (no rollback needed). Separately, the SRE agent's last run ended by asking the user a question in a fully non-interactive CI run, which must never happen again. The per-pod-label scrape fix itself is being done in the infra repo, not here.Test plan
bash -n scripts/verify-deploy.sh— syntax OKshellcheck scripts/verify-deploy.sh— 0 findingspython3 -c 'import yaml; yaml.safe_load(open(".github/workflows/_sre-agent.yml"))'— OKactionlint .github/workflows/_sre-agent.yml— 0 findings.githooks/pre-commitcomment-ratio gate — passed (Shell +1/+0, ratio 1.00 but under floor 5; YAML +2/+19, ratio 0.10 under limit 0.30)🤖 Generated with Claude Code
https://claude.ai/code/session_01DzfsFzcMzXbJNiLthAfUQg