ENG-10Recommended
Release to a small share of traffic first
Send a new release to a small share of traffic first, compare it with the old one, and roll back by itself when errors rise.
How to do it
Start with a canary, such as 5% of requests or one server, for a set time such as 10 minutes. Compare its error rate and response time with the rest. Set the rollback threshold before the rollout, such as an error rate one percentage point above the old release. Widen the share in steps only while the canary stays under it. Tools such as Argo Rollouts or Flagger automate the steps and the comparison. A single small server can use the health check and a short watch window instead, as the one-step deploy shows. App store updates roll out the same way, as Roll out store updates to a share of users first says.
Examples
YAML example
# Argo Rollouts: 5%, then 25%, then everyone, with an error-rate analysis running throughout
strategy:
canary:
analysis:
templates:
- templateName: error-rate
startingStep: 1
steps:
- setWeight: 5
- pause: { duration: 10m }
- setWeight: 25
- pause: { duration: 10m }
How to check
Deploy a test release that returns errors on purpose. The rollout stops at the first step and returns to the old release without a person acting.
Sources
Related rules
- ENG-8 Deploy in one step and roll back by itself in Engineering
- MOB-11 Roll out store updates to a share of users first in Mobile apps
- ENG-12 Roll out settings and data files like code in Engineering
- ENG-72 Upgrade one major version at a time in Engineering
- OPS-38 Walk through a launch checklist before users arrive in Operations and observability
- INF-12 Change staging before production in Infrastructure and environments
- MOB-17 Ship over-the-air updates only within store rules in Mobile apps
- DSK-8 Roll out each update in stages with a stop switch in Desktop apps and extensions
- MLO-27 Release models through a canary that compares predictions in Machine learning
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/engineering/build-test-and-deploy/staged-rollouts">Agent Wranglers engineering playbook</a>. In code you write, add a comment next to it with the same link.