Topic 2 of 4 · 4 min read
Staged rollouts and canary checks
Goal: Plan a staged rollout with the metric thresholds that pause or roll back the release.
Release in stages, from a small slice of traffic to everyone, and write down before you start which numbers will pause or roll back the release. The thresholds are decided while calm, not argued about during an incident.
Check yourself · 1 of 3
What is a canary in a release?
Why it matters
Tests run before release and see the world you imagined. Real traffic has odd users, old clients and load you did not model. An agent-built change has had less human thought per line than hand-written code, so it deserves a gentler road to production. A canary is a small group that gets the new version first, compared against the group still on the old one. Google's SRE Workbook describes this as the core of safe releases.
How to do it
- Pick the stages. For example 1 percent, 10 percent, 50 percent, 100 percent. Each stage has a minimum soak time, long enough to see a real sample.
- Pick two or three metrics that would show harm. Error rate, latency at the 95th percentile, and one business metric such as checkout completions. Compare canary against baseline, not against yesterday.
- Set the thresholds in numbers. "Pause if the canary error rate is more than 0.5 points above baseline for 10 minutes. Roll back if it is more than 2 points."
- Say who decides and how. Automatic where possible, otherwise a named person with the rollback command in the plan.
- Watch the right slice. If the change touches one region or plan type, make sure that slice is in the canary.
Before and after
Weak plan, as an agent might draft it:
Deploy to production. Monitor for issues. Roll back if needed.
Fixed plan:
Stage 1: 1% for 30 min. Stage 2: 10% for 2 h. Stage 3: 50% for 4 h.
Pause: 5xx rate > baseline + 0.5 pt for 10 min, or p95 latency > baseline + 20%.
Roll back: 5xx rate > baseline + 2 pt, or checkout completions < baseline - 5%.
Owner: on-call. Rollback: flag off, then redeploy previous build.
What goes wrong
- Vague thresholds. "Looks bad" gets argued while users suffer.
- Canary too small or too short. A 1 percent slice for five minutes may see no errors only because it saw few requests.
- Wrong comparison. Comparing against last week confuses the release with a Monday traffic spike.
- Plan written by the agent, accepted unread. Agents write confident plans with no numbers. Check every threshold is a number.
Examples
Turning a vague agent plan into a real one
The agent drafts: "Roll out gradually and watch dashboards." You reply: "Give stages, soak times, two health metrics and one business metric, each with a pause and a rollback threshold, and name who acts." The second draft can be reviewed line by line.
A canary that missed the point
A change affects only annual-plan customers, who are 3 percent of users. A 1 percent random canary has almost none of them. The team targets the canary at annual-plan accounts so the affected path is actually exercised.
Key points
- A staged rollout moves from a small slice to everyone, with a minimum soak time at each stage.
- Write pause and rollback thresholds as numbers before the release starts.
- Compare the canary against the baseline running at the same time, not against another day.
- Include a business metric as well as errors and latency.
- A plan that says "monitor for issues" has no thresholds and is not a plan.
Common mistakes
- Writing thresholds as words such as "significant" instead of numbers.
- Using a canary slice too small or too short to produce a meaningful sample.
- Comparing the canary against an earlier day rather than the live baseline.
- Having no named owner or tested rollback command at each stage.
Check yourself · 2 of 3
Which rollback rule is best written into a rollout plan?
Check yourself · 3 of 3
Why compare a canary against the current baseline instead of last week?
Practice items, not counted towards your mastery.
Start here
- Feature Toggles (martinfowler.com) (opens in a new tab)ArticleFree
The standard taxonomy of toggles (release, ops, experiment, permission) and why short-lived ones must be removed.
- Canarying releases (Google SRE Workbook) (opens in a new tab)BookFree
How to release to a small slice, pick metrics to compare and decide when to roll back.
- Parallel Change (martinfowler.com) (opens in a new tab)ArticleFree
The expand, migrate, contract pattern behind reversible schema and API changes.