How to Do a Canary Rollout With Feature Flags
Target the flag at a small canary segment, watch metrics, then widen the audience or turn it off.
Canary releasing with flags means enabling a feature for a tiny slice of traffic first. You expand exposure only after the canary looks healthy, and revert instantly by flipping the flag off.
Steps
- Define a canary segment (internal users or 1% of traffic).
- Enable the flag for that segment only.
- Monitor error rate and latency for the canary.
- Widen the rollout or disable the flag based on the result.
Canary targeting rule
flags.yaml
flags:
new-checkout:
defaultVariation: false
rules:
- segment: canary # internal users + 1% bucket
variation: truePromote after the canary passes
Terminal
# Terminal: widen once canary metrics are clean
flagctl update new-checkout --segment beta --variation true
flagctl update new-checkout --rollout 25Gotchas
- A canary segment too small to produce traffic tells you nothing; size it for signal.
- Pair the canary with alerts so you catch regressions before you widen exposure.
Related guides
How to Do a Percentage Rollout With Feature FlagsEnable a feature for a growing percentage of users with a feature flag rollout, bucketing by a stable key so…
How to Combine Feature Flags With Progressive DeliveryLayer feature flags on top of a progressive delivery pipeline so CD ships the artifact everywhere while flags…