Skip to content

v2: consistency SLOs — orders final within 5 minutes, none stuck (storefront v2 M6) - #131

Merged
MIERAI merged 1 commit into
mainfrom
m6-consistency-slo
Nov 23, 2026
Merged

MIERAI merged 1 commit into
mainfrom
m6-consistency-slo

Conversation

@MIERAI

@MIERAI MIERAI commented Nov 23, 2026

Copy link
Copy Markdown
Owner

The consistency-* SLOs reserved in v2/app.yaml (#127): design §0's "eventual consistency" promise — every accepted order reaches CONFIRMED or CANCELLED in time — as SLOs on order's state-machine metrics (api-factory-runtime).

SLO Type SLI
consistency-final-5m latency, 99% factory_sm_completion_seconds{app="order", machine="OrderSaga"} ≤ 300s (created → final; the bucket edge exists)
consistency-none-stuck bool, 99% new recording rule storefront:order_saga_none_stuck_5m:bool = max by (namespace)(factory_sm_oldest_in_state_seconds{app="order", machine="OrderSaga"}) < bool 300 (v2/base/consistency.yaml)

Why two: the latency SLO only sees orders that finished. An order stuck in CHARGING (no deadline there by design) never finishes, so only the oldest-in-state gauge sees it.

No-oversell / no-double-charge SLOs (design §11.1) are deliberately not metrics: the databases make them structurally impossible (CHECK (available >= 0), payments keyed by order_id), so a gauge could only ever be 1. They are proven by storefront scripts/m6/check.py (SQL: stock books balance, one succeeded payment per confirmed order = its total, no charge kept for a cancelled order) in the M6 experiments.

Rendered locally (render.py render v2-slo-lab): two new ServiceLevelObjectives, v2-consistency-final-5m and v2-consistency-none-stuck; v2-lab gains one PrometheusRule (consistency). Lab only (notifies nobody). The M6 fault experiments allow pages from ErrorBudgetBurn{namespace="v2-lab"} (these will burn during a 10-minute outage, as predicted) and hold v2-browse-availability / v2-place-order-availability quiet.

🤖 Generated with Claude Code

…refront v2 M6)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Rendered diff (as Argo CD renders: kustomize / Helm, against origin/main)

v2-lab (+15 / -0)
@@ -964,6 +964,21 @@
     matchLabels:
       storefront-v2/role: service
 ---
+apiVersion: monitoring.coreos.com/v1
+kind: PrometheusRule
+metadata:
+  labels:
+    app.kubernetes.io/part-of: storefront-v2
+  name: consistency
+  namespace: v2-lab
+spec:
+  groups:
+  - name: storefront-v2.consistency
+    rules:
+    - expr: max by (namespace) (factory_sm_oldest_in_state_seconds{app="order", machine="OrderSaga"})
+        < bool 300
+      record: storefront:order_saga_none_stuck_5m:bool
+---
 apiVersion: networking.k8s.io/v1
 kind: NetworkPolicy
 metadata:

@MIERAI
MIERAI merged commit bd6fd68 into main Nov 23, 2026
2 checks passed
@MIERAI
MIERAI deleted the m6-consistency-slo branch November 23, 2026 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant