Canary Release and Progressive Rollout
Metric-driven traffic ramp (1% → 10% → 50% → 100%) with automatic rollback on error budget breach.
Why
Canary limits blast radius: a bad deploy affects 1% of users, not 100%. Progressive rollout with automatic metric gates (error rate, latency p99, business KPIs) catches regressions that pass staging but fail at production scale, rolling back before customers notice.
The CNCF 2024 survey shows Prometheus and Grafana are used by 70%+ of cloud-native organizations. OpenTelemetry became the standard for instrumentation in 2024, reducing vendor lock-in for metrics and traces.
When
Use canary for high-risk changes (payment flow, auth, schema migrations), high-traffic services (>10k RPS), and continuous deployment. Skip for low-traffic internal tools where blue-green suffices and the canary signal is too noisy at 1%.
How
Example
Common Problems
- ⚠1% traffic too noisy — at 100 RPS, 1% = 1 req/s, error rate swings wildly, use longer analysis window
- ⚠Metric gate too loose — p99 < 1s passes but p99.9 is 10s, 0.1% of users get terrible latency
- ⚠Business KPI not measured — error rate fine but conversion drops 20%, canary 'passes' and ships the bug
- ⚠No baseline comparison — canary metrics checked against absolute threshold, not vs stable version
Best Practices
- ✓Compare canary vs stable (relative), not absolute thresholds — catches 'both bad but canary worse'
- ✓Include a business KPI metric — error rate + latency + conversion, not just infra metrics
- ✓Set failureLimit to 2-3 — one bad sample shouldn't rollback, but a trend should
- ✓Mirror traffic before canary — shadow real requests to canary, compare responses without user impact
FAQ
What percentage should I start my canary at?
Start at 1-5% for 15-30 min, then ramp to 10%, 25%, 50%, 100% if metrics are clean. Starting at 50% defeats the purpose — you affect half your users before catching issues. Use automated progressive delivery (Flagger, Argo Rollouts).
What metrics should I watch during a canary?
Error rate (5xx), latency p99, and business metrics (conversion, signup). Set thresholds before deploying — e.g., rollback if error rate exceeds 0.5% or p99 latency increases over 20%. Don't watch CPU/memory; they don't indicate user impact.
How is canary different from A/B testing?
Canary tests for errors/performance (does the new version break?), A/B tests for business outcomes (does it convert better?). Canary is a safety mechanism; A/B is an experiment. You can run canary within an A/B test.
How do I route only some users to the canary?
Use a weighted load balancer (Istio, ALB weighted target groups) or a feature flag with a percentage rollout. Sticky sessions ensure a user stays on the same version — otherwise they'll see flapping behavior.
How long should a canary run before full rollout?
Long enough to see meaningful traffic — at least 10,000 requests or 30 min, whichever is longer. Too short and you miss rare errors; too long and you delay the release. Automate the ramp so you don't babysit it.