← CodeClarityLab Home
Browse by Category
+ added · updated 7d
← Back to glossary

Canary Deployment & Observability

observability Intermediate

TL;DR

Canary deployments route a small percentage of traffic to a new version — compare its golden signals against the stable version before full rollout to catch regressions automatically.

Explanation

Canary: deploy new version to 1-5% of traffic. Monitor: error rate, latency p99, business metrics (conversion, payment success). Automated rollback if canary metrics degrade vs baseline. Implementation: load balancer weights (nginx upstream, AWS ALB weighted target groups), Kubernetes (Argo Rollouts, Flagger), feature flags. Key metrics to compare: error rate, latency (all percentiles), business KPIs. Duration: 10-30 minutes for fast feedback, hours for low-traffic metrics. Observability requirement: metrics must be tagged with version to split canary vs stable. Autocanary: Flagger automates comparison and rollback.

Common Misconception

Canary deployment is just blue-green with partial traffic — canary involves active comparison and automatic rollback based on metrics, not just traffic splitting.

Why It Matters

Canary deployments with automated metric comparison catch production regressions before they affect all users — limiting blast radius from bad deployments.

Common Mistakes

  • No version labels on metrics — can't compare canary vs stable.
  • Canary period too short — not enough traffic for statistical significance.
  • Manual rollback only — automate based on error rate threshold.

Code Examples

✗ Vulnerable
# Deploy to 5% but no metric comparison:
upstream backend {
    server stable weight=95;
    server canary weight=5;
}
# No monitoring — how do you know if canary is healthy?
✓ Fixed
# Flagger automated canary:
analysis:
  interval: 1m
  threshold: 5
  metrics:
    - name: request-success-rate
      thresholdRange:
        min: 99
    - name: request-duration
      thresholdRange:
        max: 500
# Auto-rollback if success rate < 99% or p99 > 500ms

Added 23 Mar 2026
Views 34
Rate this term
No ratings yet
🤖 AI Guestbook educational data only
| |
Last 30 days
0 pings W 0 pings T 0 pings F 0 pings S 0 pings S 0 pings M 0 pings T 0 pings W 0 pings T 1 ping F 0 pings S 0 pings S 0 pings M 2 pings T 0 pings W 0 pings T 2 pings F 1 ping S 0 pings S 0 pings M 0 pings T 1 ping W 0 pings T 2 pings F 0 pings S 1 ping S 0 pings M 0 pings T 1 ping W 0 pings T
No pings yet today
Amazonbot 8 Perplexity 6 ChatGPT 5 Unknown AI 3 Google 3 Ahrefs 2 SEMrush 2 Meta AI 1
crawler 29 pre-tracking 1
DEV INTEL Tools & Severity
🟡 Medium ⚙ Fix effort: High
⚡ Quick Fix
Tag all metrics with version label. Compare canary vs stable error rate and p99 latency. Set auto-rollback threshold. Run canary for minimum 10 minutes or 100 samples.
📦 Applies To
web
🔗 Prerequisites
🔍 Detection Hints
canary|weight|flagger
Auto-detectable: ✗ No flagger argo-rollouts
⚠ Related Problems
🤖 AI Agent
Confidence: Low False Positives: High ✗ Manual fix Fix: High Context: File

✓ schema.org compliant