Inventory ledger writes are the source of truth for stock. Failed appends mean sales and receipts are not reflected in stock, so a data-integrity review is required after every incident here.
Warning at ledger write failure rate ≥ 1%, critical at ≥ 3%. Critical means user-visible impact: page the escalation owner.
dashboard: sim://grafana/ledger-enginelogs: sim://logs/ledger-engineowner: Inventory Teamrunbook: RB-LEDGERENGINE
- Primary metric: ledger write failure rate (%)
- Warning threshold: ≥ 1%
- Critical threshold: ≥ 3%
- Dashboard: sim://grafana/ledger-engine
- Log source: sim://logs/ledger-engine
- SLA: 99.5% monthly availability
- SLO: 99.99% successful ledger writes
- External dependencies: Supabase PostgreSQL / APIs / Realtime
- Ledger write monitor reports ledger write failure rate above the warning threshold — writes are being rejected or rolled back.
- Downstream records appear missing or inconsistent to operators.
- Identify the failing operation type: sale-out, purchase-in, transfer, stocktake adjustment.
- Inspect the last failed ledger transactions and capture the exact database error.
- Check for constraint violations, deadlocks or serialization failures.
- Determine whether the data layer is also degraded — if so treat the database as the primary incident.
- Stop bulk import and stocktake jobs so retries do not compound the failure.
- If a specific store or item range is failing, isolate it and let the remaining traffic proceed.
- Re-drive failed ledger appends from the retry queue once the underlying error is cleared.
- Confirm ledger write failure rate is back under the warning threshold for at least 10 minutes.
- Reconcile stock on hand against ledger sums for affected items and locations.
- Confirm no orphaned sales or receipts exist without matching ledger entries.
- If a deploy caused the incident, roll back to the previous release and re-verify.
- If a configuration or threshold change caused it, restore the previous value and record why.
- Re-enable any job, feature flag or channel that was paused during mitigation, one at a time.
- First responder: NOC on duty — acknowledge within 5 minutes.
- Component owner: Inventory Team.
- Escalation owner (page on critical): Inventory On-Call.
- Escalate if the metric is still critical 15 minutes after mitigation, or if data integrity is in doubt.
- Declare a major incident if two or more critical components are alerting at the same time.
Blast radius — business services affected (18)
Batch ManagementSerial Number ManagementInventory LedgerWarehouse InventoryStock TransferStocktake & AdjustmentLow-Stock AlertsSales / POSSales Returns / ReversalsPurchasingPurchase ReturnsB2B Transaction ConversionB2B ReceivingSupplier SalesRental ManagementInventory SynchronizationE-Commerce Order ImportPWA / Offline Operations
Supabase PostgreSQL / APIs / Realtime — Primary data plane, RPC and realtime channels
Simulated incidents that exercise this runbook
Supabase DB degradation — Primary Postgres data plane latency spike; RPC timeouts across engines.
Inventory ledger write failures — Ledger append transactions rolling back; stock movements not persisted.
- Record start time, actions taken and recovery time in the incident record.
- Attach the dashboard screenshot and the dominant error message to the postmortem.
- Content drafted for the monitoring demo — confirm the exact commands with the owning team before production use.