Canary Checkout Regression: Localize Before Rolling Back
An e-commerce checkout API runs on Kubernetes with 24 pods and peaks at 14,000 requests per minute. At 09:10 a canary release of v2.8.1 reaches three pods. By 09:25 checkout p99 has risen from 420 ms to 2.1 s, 5xx from 0.2% to 1.6%, and the canary pods show four times the CPU of baseline pods plus a 12-second connection-pool wait. Checkout calls inventory, payment, and a third-party tax API. Distributed tracing samples 10%. The tax call p95 is unchanged at 300 ms; inventory p95 has risen from 80 ms to 900 ms. Only one alert fires: checkout error rate above 1% for five minutes. The incident commander has eight minutes before deciding whether to roll back, and support has promised a 30-minute recovery target.
1. How would you localize the regression to the canary rather than the inventory dependency? Name the views or queries and the comparison you would make.
Read the worked answer
Localize before blaming the dependency
- Split the checkout APM summary by pod or Deployment (for example
pod.nameor a canary tag). Compare canary p99, throughput, error rate, and CPU with baseline pods over the same 15-minute window. If only the three canary pods degrade, inventory is more likely a victim than the root cause. - Use the service map to check whether inventory is slow for all callers or only for canary checkout traffic. Slowness that appears only on canary requests points to a client-side change: connection pooling, DNS, TLS, retries, or a new call pattern.
- Pull the slowest distributed traces for canary checkout requests. In the waterfall, separate inventory span time from time spent waiting for a connection, serializing, or retrying. Inspect span counts and error attributes, not only p95, because 10% sampling can hide rare failures.
- Check the errors inbox and deployment markers around 09:10. A new error class on canary pods is stronger evidence than a shared dependency slowdown.
Decision rule
If canary error rate and latency are materially worse than baseline while baseline is healthy, treat the release as the cause. If inventory is slow for baseline traffic too, rollback will not recover the service and you should escalate to the inventory owner.
2. What criteria would you use to choose rollback versus a forward fix, given the 30-minute recovery target?
Read the worked answer
Rollback is the default when the canary is the only affected cohort and the change is reversible within minutes. The reasoning is blast radius and reversibility: a rollback removes the suspect code from three pods quickly, while a forward fix requires diagnosis, review, build, and redeploy. A practical trigger is canary error rate above 1% or p99 above twice baseline combined with a burn rate that threatens the service-level objective; with a 30-minute promise, spending eight minutes on a speculative fix is risky.
A forward fix is justified only if evidence shows the dependency is degraded for all callers, or if rollback itself is unsafe because the release includes a required migration. In that case, isolate the canary with traffic weighting, disable the new code path behind a feature flag, and timebox the attempt.
Either way, verify recovery with the same broken-down view used for diagnosis: canary p99, 5xx, and connection-pool wait. Do not declare recovery from a single aggregate error-rate chart, because baseline traffic can mask a still-broken canary.
3. Redesign the single alert so this class of regression pages earlier without creating noise.
Read the worked answer
The existing alert pages on a static aggregate error rate, so it fires after customers are already failing and does not identify the canary. Replace it with symptom-based, segmented conditions:
- A multi-window SLO burn-rate alert for checkout success and latency, because burn rate expresses customer impact better than a raw 1% threshold.
- A canary-specific condition on error rate or Apdex, evaluated only for pods carrying the canary tag, so a small cohort is visible before it contaminates the aggregate.
- A latency condition on p99 or Apdex rather than CPU; CPU is a cause signal and can rise during legitimate traffic events.
- A synthetic checkout transaction from at least two regions to catch total failures that internal telemetry may miss.
Use alert grouping so the canary, payment, and inventory symptoms become one incident rather than three pages. Before enabling, backtest thresholds against a week of data and confirm the canary tag is present on every telemetry signal. The goal is earlier detection with a named owner and a runbook, not simply a lower threshold.