Bookmarks

Canary release

A release approach in which a new version is first enabled for a small share of traffic, and metrics decide whether to widen the release or roll it back.

Also: canary release, canary, canary deployment (Kubernetes practice), phased rollout

checked 9 Nov

All terms

The idea is simple: rather than risk every user at once, expose only a small share — one percent is enough for the new version to prove itself on real traffic. The name comes from mining practice: a canary was taken into the mine and warned of gas before people were.

How the release works

StageShare of trafficWhat to watch
Trial1–5%error rate, latency, logs — any obvious failures
Observation5–25%the same metrics over an hour or a day, compared with the old version
Widening25–100%gradually move all traffic across, or roll back if things degrade

Traffic is split by a router — a load balancer, an ingress controller or a service mesh: each request gets a random or rule-based chance of reaching the new version. Splitting need not go by shares: first send one region or one user group, then widen. If the metrics dip, the share is cut back to zero — rolling back amounts to reconfiguring the routing, and anyone not yet on the new version will not notice a thing.

Deciding on metrics

The heart of a canary release is not the rollout but the decision criterion. Metrics of the new and old versions are compared: the share of 5xx responses, p95 latency, memory use, conversion or another business indicator. The criterion is fixed in advance, for example “a 5xx share above 0.5% for ten minutes — roll back”.

yamlCanary release steps in Argo Rollouts: the pauses leave time to look at the metrics
steps:  - setWeight: 5  - pause: {duration: 10m}  - setWeight: 25  - pause: {duration: 1h}  - setWeight: 50  - pause: {duration: 1h}

The analysis can be automated: Argo Rollouts and Flagger compare Prometheus metrics at every step on their own and roll the version back once a threshold is exceeded. The release then runs without anyone on duty, and a human only investigates the rollbacks.

How it differs from other strategies

A canary release differs from blue-green deployment in the size of the risk: blue-green keeps two identical environments and switches all traffic at once, while a canary goes gradually, starting from a small share. From a rolling update in Kubernetes it differs in that traffic is split by version rather than by shares of pods, and the decision is made by metric analysis, not by a count of ready pods.

Martin Fowler described the canary release in his bliki in 2014, noting that the practice had long been in use by then. The same technique is also called a phased or incremental rollout; it is covered in detail in the book Continuous Delivery by Jez Humble and David Farley.

Sources

the term is written from these pages

Verified 9 Nov

Not to be confused with

what it is mixed up with and how it differs

  • blue-green deployment

    Blue-green deployment switches all traffic to the new environment at once; a canary release does it in shares, from 1% to 100%.

  • rolling update

    In a rolling update, pods of the old version are replaced; in a canary release, traffic is split between versions according to rules.

  • feature flag

    A feature flag turns code on for part of the users within a single version; a canary ships a separate version of the application.

In depth in the references

where the topic is covered in detail