Repository navigation
docs(ops): add operations runbook — processes, dependencies, health checks, failure modes, rollback - #557
Open
felixumeh wants to merge 1 commit into
Open
docs(ops): add operations runbook — processes, dependencies, health checks, failure modes, rollback#557felixumeh wants to merge 1 commit into
felixumeh wants to merge 1 commit into
Conversation
Ground every claim in the code that exists today (file/symbol named next to each one) so the runbook describes the system as it behaves, not as it should behave: processes and startup order, per-dependency degraded behaviour, /status and /metrics health checks, the known failure modes of this batch with the endpoint or metric that shows each one, and deploy/rollback including what the boot-time `prisma db push --accept-data-loss` can destroy. Closes Divinity-Labs#350 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
felixumeh
force-pushed
the
docs/runbook
branch
from
October 19, 2026 17:02
385ebec to
568ae9a
Compare
|
@felixumeh Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Closes #350
Summary
Adds
docs/RUNBOOK.md— the operational runbook issue #350 asks for — and links it from the README's Documentation section. Every claim in the document names the file or symbol it is checkable against, and where the system does the wrong thing (no shutdown handler, no 429 handling, aggregate refresh has no fallback) the runbook says so instead of describing an aspirational system.Why
The operational knowledge for Lens — that Redis loss silently freezes
price_aggregateswhile/pricekeeps serving, that startup runsprisma db push --accept-data-lossbefore the API listens, that/status'sok: trueis a DB-liveness signal and not a freshness signal — currently lives only in the code and in whoever last read it. An operator at 03:00 needs one document that maps symptom → endpoint or metric → cause.What the runbook covers (mapped to the issue)
npm startprocess (API, WebSocket fan-out, venue + snapshot ingesters, BullMQ workers, webhook dispatcher, boot-time auto-migration, health probes), its exact startup order with hard vs soft failure points (ending inmarkBootComplete()), compose services, optional example processes, and all five GitHub Actions workflows/readysignals: Postgres reachability and migration state, Redis PING)/statusand/metrics/statusreading (whyok: trueis not freshness, why lag can grow on an idle market), the/liveand/readyprobes with their semantics,/snapshotas a one-shot freshness view, the ingestion/API metric table with PromQL recipes (including the new auth/rate-limit/shed counters), known blind spots, and a 5-step triage sequence--accept-data-lossauto-migration and holding the instance out of rotation via/ready), and a 5-step rollback: code → schema → data → config → verificationLoad test (prices)failing onmainis a known, unrelated redAcceptance criteria
docs/RUNBOOK.mdexists and is linked from the READMEVerification
The full CI sequence from
.github/workflows/ci.ymlwas run locally after rebasing onto the currentmain, with exit statuses captured (pipefail):npm ci— ✅node node_modules/prisma/build/index.js generate— ✅ (required:mainaddedexpiresAtto the Prisma schema)npx tsc --noEmit— ✅ 0 errorsnpm run build— ✅npm test --if-present— ✅ 84 files, 908 passed, 1 skipped (tests/integration/e2e.test.ts, skipped in CI as well), exit 0The branch was rebased onto
mainafter the first draft, which had landed the health-probe, auth-metric, and admin-token-refactor PRs in the meantime. Every claim was re-verified against the new code and the runbook updated accordingly:/live+/ready+/snapshotand the four new counters are now covered, the admin-auth citation moved tosrc/api/auth.ts, and readiness became a symptom signal in §2.Claims that were least obvious were verified against the code, not assumed:
SIGTERM/SIGINT/unhandledRejection/uncaughtExceptionhandler exists anywhere insrc/(re-checked after the rebase) → §4 rows 1–2/statusreturnsok: trueunconditionally, and only the SDEX/AMM ingesters writeindexer_state→ §3 caveatLoad test (prices)has failed on every daily run for the last 8+ days onmain, whileci.ymlis green — confirming the issue's note that it is an unrelated redCI on this PR: the
pull_requestrun was created (run 39290710090) but reportsaction_required— this repository requires maintainer approval before workflows run for fork PRs, and I cannot approve my own run. The identical job (Typecheck & build) passed locally as listed above; a maintainer just needs to approve the run.Notes
docs/RUNBOOK.md(new) + 2 lines inREADME.md. No source, schema, or lockfile changes (a stray localpackage-lock.jsonmodification was deliberately excluded to keep the PR focused), and no changeset since nothing user-facing changed.