Ship in Stages: Canary vs Feature Flags
You can't ship zero bugs, but you can choose how many people step on them. Release to everyone at once and one bug reaches everyone. Release in stages and the same bug stops at a few percent of users. This article covers how to choose between canary releases and feature flags, how to size each stage, and how to design the rollback.
Canary and feature flags protect different things
- Canary release: send only part of the traffic to a new build. The unit is the deployment. It catches infrastructure, dependency and startup problems.
- Feature flag: ship the code to everyone, but switch the feature on per user. The unit is the feature. It separates deploy from release and lets you turn things off without redeploying.
Rule of thumb: changes that affect the whole build (migrations, config) go through canary; feature-level changes (screens, behavior) go behind a flag. For big changes, layer them: confirm the new build is healthy with a canary, then open the feature gradually with a flag.
Sizing the stages
Start with a group small enough that breaking it doesn't hurt:
- Internal members only (dogfooding)
- 1% of users
- 5%
- 25%
- 100%
Write the advance and rollback conditions as numbers before you start:
Advance: 30 min with error rate within baseline +0.5pt and zero support tickets
Roll back: error rate above baseline +2pt, or one high-severity reportMatch the observation window to usage frequency. Watching a once-a-day feature for 30 minutes tells you nothing; wait at least one full usage cycle.
Manage the lifetime of flags
A forgotten flag becomes the next bug. Months after reaching 100%, stale branches go unread and the number of test combinations keeps growing. When you create a flag, decide:
- A removal date (for example, within two sprints of full rollout)
- An owner
- A type: release (short-lived), ops switch (long-lived) or experiment
// Keep the deadline in the code
const flags = {
newCheckout: { owner: "pay-team", removeBy: "2026-12-15" },
};Have CI fail when a flag passes its removeBy date, so cleanup doesn't depend on memory.
Design the rollback first
- Does turning the flag off really restore the old behavior? Test the off path at least once.
- Can the data go back? If old code can't read what the new feature wrote, rolling back still breaks things. Split write-format changes into expand, migrate, contract.
- Who rolls back? Name someone who can decide at night, and allow rollback without consultation once the condition is crossed.
Failure examples: stages that didn't help
- The 1% happened to be in a region or device group that barely uses the feature. Pick the sample so devices, regions and plans aren't skewed.
- Only the error rate was watched, so a broken layout that didn't throw errors slipped through. Include user reports in the rollback condition.
- The flag-off path hadn't been tested for years, so rolling back produced a different bug.
Putting it into practice with Bugoon
In a staged release, the key is catching problems that metrics don't show. With the Bugoon widget embedded in your site, anyone who notices something at the 1% stage can report it right from that screen, with a screenshot and annotations. Recorded operation steps provide the reproduction, and the report goes to a GitHub Issue, so you can judge quickly whether it meets your rollback condition. You can also line up reports per stage on the kanban board. If reports also carried the release version automatically, it would be easier still to see which release made them increase.
Streamline bug reporting for your team.
Bugoon is free to get started. Add one line of code to your site and transform how your team handles bugs.
Get Started