Canaries expose a change to a bounded audience before broader rollout. The comparison requires meaningful metrics and comparable traffic.
Before you start
You should understand commits, branches, the working tree and the staging area. Draw the commit graph before changing history. Try commands in a disposable repository with a clean working tree so you can observe exactly which references and files each operation changes.
The practical goal is to reason through this situation: Compare error and latency distributions between new and stable instances. Read the walkthrough first, then try the interview exercise before opening its answer. The important part is explaining the decision and its consequences, rather than remembering a definition alone.
Step-by-step walkthrough
Step 1: Define comparable cohorts
Traffic mix can distort conclusions between versions.
Step 2: Set evidence thresholds
Use sufficient exposure and user-impact metrics before promotion.
Step 3: Prepare rollback triggers
Decide failure criteria before observing the release.
Worked scenario
Compare error and latency distributions between new and stable instances.
A canary sees only internal users while the stable release handles large customer payloads. Its low error rate may reflect easier traffic rather than correctness. Compare representative latency and failure distributions, include rare-event exposure requirements, and account for mixed-version interactions before expanding the rollout.
Common mistake
Low canary traffic can hide rare failures, and biased cohorts can distort conclusions.
Verify the behavior
Inject a known regression and verify promotion stops under the declared criteria.
Interview exercise
Define promotion criteria.
Answer and reasoning
Set minimum evidence, thresholds and rollback triggers linked to user impact before the canary begins.
Continue learning
Compare the scenario with the Git and CI/CD interview questions and test your understanding with the Git and CI/CD MCQs. For terminology and implementation details, consult the reference material.