Agent Wranglers

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

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.