P2: Operations runbook — SLOs, capacity, incidents, failover (#180) - #197
P2: Operations runbook — SLOs, capacity, incidents, failover (#180)#197dkijania wants to merge 2 commits into
Conversation
There was one benchmark data point but no runbook, SLOs, or documented failure-mode response. Add docs/runbook.md: - Starting SLOs (availability, p50/p99 latency, error rate). - What to watch (the /metrics RED signals, readiness, structured logs) and suggested alerts. - Scaling & capacity guidance — stateless horizontal scaling, Postgres as the real ceiling, pool-vs-max_connections math. - Multi-host Postgres failover semantics and recovery expectations. - A common-incidents table mapping symptoms to causes and actions. - Deploy/rollback notes tied to graceful shutdown and readiness gating. Linked from the README. An automated replica-failover test is noted as a follow-up (needs a multi-host DB harness). Closes #180. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QSuak9smCHbp4N17xjjLF6
|
Great capstone for the epic — the symptom→cause→action table and the honest "validate for your topology" failover caveat are exactly what on-call wants. One correctness heads-up before merge: almost everything the runbook tells operators to observe or tune ships in sibling PRs that aren't on
Docs PRs tend to merge ahead of feature PRs, and if this one lands first the runbook misdirects on-call mid-incident (curling
One smaller note on Scaling: "Add read replicas and point Nice work overall — just want the doc to be safe to follow the day it merges. |
…Y row Scaling told operators to "add read replicas and point PG_CONN at them before scaling the API further", which reads as added read capacity. It isn't: postgres.js scopes hostIndex per Connection, so every pooled connection starts at host[0] and only advances on failure. Extra hosts buy redundancy, not throughput — real read scaling needs a balancer in front of Postgres. The failover section now says so plainly rather than leaving "connects to an available host" open to the throughput reading. Adds a version scope note. Nearly everything the runbook says to observe or tune ships in 1.0.0; on 0.0.x, /readiness 404s, the tuning knobs are no-ops, and SIGTERM skips the drain. A runbook that misdirects mid- incident is worse than no runbook, and the published image today is 0.0.6. Scoping by version rather than by in-flight PR numbers keeps the note true after the merge train lands. Splits the 429 incident row: after #185, mass 429s across unrelated clients most likely means TRUST_PROXY is unset behind a gateway, collapsing every client into one bucket — a different fix from a single client exceeding the limit. Addresses review feedback on #197. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Thanks @SanabriaRusso — fixed in The "describes unshipped behavior" problem. Agreed this was the important one: a runbook that misdirects on-call mid-incident is worse than no runbook. Of your two options I took a third — scoping by version rather than by in-flight PR numbers:
Reasoning: the merge plan already lands this doc after #182/#185/#187/#188/#191, so a PR-status banner would be stale on arrival and need deleting. The version framing stays true afterwards and is arguably the more useful warning anyway — the published image today is The Scaling claim — you were right, and I can now say why. I checked the driver rather than take it on faith: Worth flagging that this same claim was already on One addition from the #185 fix: I split the |
What & why
Part of the production-readiness epic (#163). Closes #180.
There was one benchmark data point but no runbook, SLOs, or documented failure-mode response.
Adds
docs/runbook.md/metricsRED signals, readiness, structured logs, and suggested alert thresholds.replicas × PG_MAX_CONNECTIONSvs DBmax_connectionsmath.Linked from the README. References observability/config features delivered by the sibling PRs. An automated replica-failover test is noted as a follow-up (needs a multi-host DB harness), so the doc is the deliverable here.
Testing
Docs only.
prettier --debug-check .clean. No application code changed.🤖 Generated with Claude Code