Delivery
Automated canary analysis
A canary needs gates, not a person watching a graph. Compare the canary with the baseline on agreed metrics over a bake period, then promote it or roll it back.
A canary without automated gates depends on someone watching a dashboard at 2 a.m. Automated canary analysis compares the canary population with the baseline on agreed metrics during a bake time. Then it promotes the canary or rolls it back, with no person in the loop.
The signals to gate on
- Success rate or error ratio. Often the strongest single gate.
- Latency. Watch p50, p95 and p99. A p99-only regression still hurts customers.
- Saturation. CPU, memory and queue depth on the canary instances.
- Business checks. Checkout completion, login success, or an empty-results rate where relevant.
Bake time needs traffic
Bake time must cover enough requests, and enough of the daily pattern, for your risk. Work the numbers first. A 1% canary on a service with 100 requests per second sees about 1 request per second. Over a five-minute bake, that is about 300 requests. That may be enough for a crude error-rate gate, but it is weak for a rare endpoint. Low-traffic services need longer bakes or a bigger canary fraction.
Walking through a gate
Here is a worked example. The baseline error rate is 0.20%. A canary at 5% of traffic shows 0.80% errors over a 15-minute bake. That is enough requests to trust the ratio.
The gate fails the canary if either of these is true.
- The canary is more than the baseline plus 0.30 percentage points. Here that is
0.20 + 0.30 = 0.50%. - The canary is more than twice the baseline. Here that is
2 × 0.20 = 0.40%.
The canary at 0.80% fails both checks. The pipeline rolls traffic back to 0% and leaves the previous revision serving. No human approval is needed for the rollback.
The comparison is against the baseline, not a fixed number. Normal error rates move over time, so the canary is judged against what production is doing right now.
Expanding in waves
Amazon's public guidance describes a pattern that is worth copying even without its tools: one box, then one zone, then regional waves. Each stage has metric alarms and a mandatory bake. A defect that appears only under one zone's dependencies or traffic mix is caught before the whole region moves.
Tools that automate this include Argo Rollouts, Flagger and Spinnaker. They query the metrics you define and shift the traffic weights through a mesh, an ingress or a load balancer.
Common mistakes
- Bake times too short. The gate passes on too little traffic.
- Gating only on the average. A p99 regression then reaches customers unseen.
- A baseline that is not comparable. A canary on a different cache or hardware class gives a misleading result.
Check yourself
- A 1% canary gets 100 requests per second, and bakes for five minutes. About how many requests does it see? Answer: About 300, since 1 request per second times 300 seconds.
- Why compare with the baseline rather than a fixed error rate? Answer: Normal error rates change over time, so the canary is judged against current production.
Key takeaways
- Automate the canary gate on success rate, latency and saturation.
- Set bake times from the traffic you have, not from habit.
- Compare the canary with the baseline, using explicit thresholds.
- Expand in waves, one box, then one zone, then the region.
Further learning
Next, see what happens when a gate fails, or a release goes wrong after it is fully out: rollback and roll-forward.
Related
Deployment strategies and safe releases
Rolling, blue-green and canary deploys, automated rollback, and zero-downtime schema changes - ship often without betting the fleet on every commit.
Metrics, dashboards and alerting
Golden signals, RED and USE, Prometheus histograms and alerts that page you only when users are hurting.
SLIs, SLOs and error budgets
Define reliability in numbers users care about, then use error budgets and burn-rate alerts to balance shipping speed against stability.