What Is Canary Deployment? A Practical Guide for Teams
Summary
What is canary deployment? It is a release strategy where a new version first serves a small share of production traffic, often 1% to 10%, while you compare its error rate, latency and one business metric against the stable version. If the numbers hold, the rollout widens step by step. If they slip, you route traffic back. This guide covers the steps, a real Argo Rollouts config, how it differs from blue-green and feature flags, and the database traps.
What is canary deployment? It is a release strategy where you ship a new version to a small slice of production traffic first, say 1% to 10%, watch error rate and latency, and only widen the rollout if the numbers stay healthy. If they do not, you route that slice back to the old version. The name comes from the canary in the coal mine: a small, early warning that costs you little when it fails.
You have probably felt the alternative. A release goes out to 100% of users at 4 p.m. on a Thursday, and the first signal is a Slack thread asking why checkout is slow.
What does a canary deployment actually do?
A canary deployment runs two versions side by side. The stable version keeps serving most users. The canary version serves a deliberately small share, and a router (load balancer, service mesh, ingress or CDN rule) decides who goes where.
Martin Fowler's description of a canary release adds a detail that matters: the canary starts on servers that get no user traffic at all, then receives a few users, then more. Selection can be random, internal staff first, or based on a user attribute such as region or plan.
The point is not to prove the release is good. The point is to find out cheaply whether it is bad. Canaries catch regressions, and a typical canary window lasts minutes to hours, not days.
How does a canary rollout work, step by step?
Strip away the tooling and every canary follows the same loop.
Deploy the new version next to the old one. Same cluster, same database, no traffic yet.
Send a small percentage of traffic to it. Start at 1% to 5% for a high-traffic service, 10% to 20% for a quiet one.
Compare the canary to the baseline. Error rate, p95 latency, saturation, and at least one business metric such as completed checkouts.
Decide. Healthy for the whole window means increase the weight. Anything else means route back to the stable version.
Repeat until 100%, then retire the old version.
Step 3 is where most teams cut corners. If you only watch CPU, you will promote a release that returns wrong answers very efficiently.

What does it look like in config?
Concrete beats abstract here. This is a trimmed Argo Rollouts spec, based on the canary strategy in the Argo Rollouts docs:
strategy:
canary:
steps:
- setWeight: 10
- pause:
duration: 1h
- setWeight: 20
- pause: {} # waits for a manual promoteRead it as a script. Send 10% of traffic to the new ReplicaSet, wait an hour, move to 20%, then stop until a human runs kubectl argo rollouts promote. Add an analysis step and the controller aborts the rollout on its own when a metric query fails.
One caveat from the same docs: without a traffic router, the split is approximated by replica count. With 10 replicas and setWeight: 10, you get exactly 1 canary pod and 9 stable pods. That is fine for a rough check and useless for a 1% canary.
Canary vs blue-green vs rolling: which one do you need?
These three get confused constantly, so here is the short version.
Rolling: instances are replaced a few at a time. Rollback means redeploying the previous version. Extra cost is low.
Blue-green: a full switch from the old environment to the new one. Rollback is an instant flip back, but you pay for two full environments.
Canary: traffic shifts gradually by percentage or cohort. Rollback means rerouting the small slice. You need a traffic router and real monitoring.
Rolling updates limit blast radius only by accident: the first replaced pods take real traffic with no comparison against a baseline. Blue-green gives you a fast, clean rollback, but everyone moves at once, so a bug that only shows up under real load hits 100% of users.
Canary is the only one of the three built around measurement. Skip it if you cannot measure. Without a metric to compare, a canary is a rolling update with extra steps.
Canary deployment vs feature flags: are they the same thing?
No, and mixing them up causes real incidents. A canary controls which version of the code receives traffic. A feature flag controls which behaviour is switched on inside code that is already deployed.
They work best together. Deploy the new build as a canary to confirm it is stable, then release the risky feature behind a flag and ramp it independently. If you want the longer treatment, we covered the mechanics in what is a feature flag and the wider picture in what is progressive delivery.
Tools such as LaunchDarkly and Statsig sit on the flag side of this pair:
A canary is also not an A/B test. Fowler makes the same point: a canary looks for regressions and finishes quickly, while an A/B test compares variants to test a hypothesis and runs for days. Run both on the same traffic and each distorts the other.

Which metrics should gate a canary?
Pick three to five, decide the thresholds before the release, and write them down. A workable default set:
Error rate: the canary's 5xx rate against the baseline over the same window, not against zero.
Latency: p95 and p99, because averages hide the tail.
Saturation: CPU, memory and connection pool usage per pod.
One business metric: orders, sign-ins, messages sent. This catches the "healthy but wrong" release.
Logs: new error signatures that did not exist on the stable version.
Compare canary to baseline, not to last week. Traffic shifts through the day, and a Monday 9 a.m. spike will make any week-over-week comparison lie to you.
Where canary deployments go wrong
Three failure modes show up again and again.
Database changes. Rerouting traffic only rolls back the code. If the new version ran a destructive migration, sending users back to the old version means the old code now talks to a schema it does not understand. Fowler's note on this is blunt: the database has to support both versions during the rollout. In practice that means expand-then-contract migrations: add the column first, ship the code, remove the old column in a later release.
Sticky sessions and caches. A user who flips between versions on every request can see inconsistent behaviour. Pin users to one version for the length of the canary, by cookie or by user ID hash.
Too little traffic. A 1% canary on a service with 200 requests a minute sees 2 requests a minute. Nothing you measure from that is statistically meaningful. Either raise the percentage or lengthen the window.

Manual promotion or automated analysis?
Most teams start with a human in the loop. The pipeline shifts 5% of traffic, pauses, and an engineer looks at a dashboard before pressing promote. That is a fine place to begin, and it teaches you which metrics actually move when a release is bad.
The weakness is attention. A pause that nobody watches turns into a rubber stamp by the fourth release. Once you know which two or three queries predict trouble, move them into an automated analysis step: the controller runs the query every minute, and a threshold breach aborts the rollout without waiting for anyone to notice.
A middle path works well for risky services. Automate the abort, keep the promotion manual. Machines are good at saying no quickly. Humans are better at deciding whether a borderline result is acceptable for this particular release.
Also decide who is allowed to override a failed canary. If the answer is "anyone, when the deadline is tight," you have rebuilt the Thursday 4 p.m. release with extra ceremony. Write the rule down: an aborted canary needs a fix or a named exception from the service owner, not a rerun until it turns green.
Where does the code come into it?
Here is the part most canary guides skip. Before the first percentage is set, someone has to answer questions about the repo. Which deployment manifest owns this service? Where is the traffic weight defined, and is it overridden by a Helm values file in another repo? Which health check does the pipeline actually call?
On a 100K-line monorepo, that is an hour of grep, blame and asking around. Tools that answer questions about your own code cut that hour down, which is the use case where AI code assistants earn their place on a DevOps team:
Use them to trace config, not to approve a release. An assistant can tell you where setWeight is defined and which services share that rollout template. It cannot tell you whether your p99 is acceptable at 20% traffic. That judgement stays with the person on call.
Should you adopt canary deployments now?
Worth it if you ship to production several times a week, have per-version metrics you trust, and can route traffic by percentage. The payoff is concrete: a bad release hits 5% of users for 15 minutes instead of 100% of them for an hour.
Skip it, for now, if you deploy once a month, run a single instance, or have no dashboards. Fix observability first. A canary without metrics is a ritual, not a safety net.
Start with the smallest version that works. One service, two steps (5%, then 50%), a pause long enough to see a real traffic cycle, and an abort rule on error rate. Add automated analysis after the third release where a human caught something the dashboard should have caught.