← Concepts

阅读中文版本

Canary Analysis Strategy

Canary analysis compares the metrics of a small canary cohort against the baseline, so a regression is detected at 1% before it reaches 100% and the rollout auto-halts.

delivery

Definition

Canary analysis strategy is the deployment practice where a small percentage of traffic is routed to the new version and its metrics — error rate, latency, business KPIs — are compared statistically against the baseline, so that a regression is detected and the rollout is halted automatically before the full fleet is exposed.

Context and scope

Applied in continuous deployment, risk-bounded rollouts, and any system where the cost of a bad release justifies the canary infrastructure.

Common misconceptions

  • A canary is just a percentage rollout — it is a percentage rollout with analysis; without the comparison and the halt, it is just a slow rollout
  • Statistical significance requires a large canary — it requires a canary large enough to power the comparison; for rare events, the canary may need to be larger than the comfort level

Anti-patterns

  • Routing 1% to the canary and never looking at the metrics, so the canary is a slow rollout with no safety benefit
  • Comparing canary and baseline means without accounting for variance, calling every noise difference a regression and halting

Related concepts

Authoritative source

https://aws.amazon.com/builders-library/a-fault-injection-story/

What it is

Canary analysis strategy is the deployment practice where a small percentage of traffic is routed to the new version and its metrics — error rate, latency, business KPIs — are compared statistically against the baseline, so that a regression is detected and the rollout is halted automatically before the full fleet is exposed. Applied in continuous deployment, risk-bounded rollouts, and any system where the cost of a bad release justifies the canary infrastructure. The unit of delivery is the deployable artifact plus its configuration, and the goal is to move changes to production safely, quickly, and reversibly.

How it works

Safety comes from small batches (less change per deploy means less blast radius), automated canaries (a bad change is caught at 1% before it reaches 100%), and reversible deployments (rollback is the default escape, not a rewrite). Speed comes from pipeline parallelism and eliminating the manual gates that batch up changes. Every step produces evidence — test results, scan output, canary metrics — that the next step consumes.

When to apply and pitfalls

Apply whenever the cost of an incident exceeds the cost of the pipeline that prevents it. The pitfall is optimizing deploy speed without investing in the observability and rollback that make speed safe — fast deploys of broken code just reach the outage sooner. Another is treating the pipeline as a checklist rather than a feedback loop that improves with each deployment.