Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

prod-canary-validator

БесплатноЗапускает вложенные скриптыНе проверен

Use when a canary deploy needs an automatic promote or rollback decision instead of someone watching dashboards. Compares the canary's error rate, p50, p95…

testlandот testland★ 18 звёзд на GitHub

Об этом скилле

prod-canary-validator

Overview

A canary deploy sends the new version to a small slice of traffic, watches metrics, and promotes only if they look healthy. "Looking healthy" is usually a qualitative on-call judgment, so regressions slip through. This skill builds the deterministic canary verdict: a machine-checkable comparison of canary metrics vs baseline that emits promote / pause / rollback, running the analytical layer underneath the human review of the canary observation step (canary-release).

When to use

  • Canary deploys are part of the release process and the team wants promote/rollback decisions backed by data, not just "looks fine."
  • The team has metrics infrastructure (Datadog / Prometheus / CloudWatch) capturing the right signals.
  • A SLO depends on production verification; the canary is the earliest gate where regressions can be caught.

Step 1 - Pick the metric set

Canary metrics should cover three classes:

Class Examples Why
Reliability Error rate (5xx %), failed-request count The new code may crash.
Performance p50 / p95 / p99 latency The new code may be slow.
Business KPI Checkout-completion rate, sign-up rate, revenue/min The new code may break a flow without crashing.

Pick 5-10 metrics. More = noisier verdict (more chances to trip); fewer = blind spots.

Always include at least one business KPI - performance and reliability metrics can both look fine while the actual user outcome (checkout completion) regresses.

Step 2 - Set thresholds (absolute + relative)

Per metric, define two thresholds:

Threshold type Example
Absolute "Error rate <0.5%" - a hard floor regardless of baseline.
Relative "Error rate ≤ 1.5× baseline" - catches regressions even when baseline is high.
# canary-thresholds.yml (excerpt)
metrics:
  error_rate:
    absolute: { max: 0.5 }   # %
    relative: { max: 1.5 }   # 1.5× baseline

Full config for every metric: references/canary-thresholds.yml.

The combination is essential: absolute catches "unacceptable regardless"; relative catches "worse than the baseline by a meaningful amount."

Step 3 - Statistical significance

A 1-minute window of canary data has high variance. The verdict "canary error rate 0.4% vs baseline 0.3% - promote?" depends on sample size:

  • N=10 requests, 0.4% diff → meaningless; could be 1 vs 0 errors.
  • N=10,000 requests, 0.4% diff → statistically significant; worth flagging.

Use a two-sample test (proportion test for error rate, Welch's t-test for latency) to compute a p-value, then gate each metric: the absolute floor fails unconditionally, but the relative limit fails only when the difference is statistically significant.

# core gate; full script: scripts/canary_verdict.py
def gate(metric, canary, baseline, t, p, alpha=0.05):
    if 'max' in t.get('absolute', {}) and canary.value > t['absolute']['max']:
        return 'fail-absolute'
    ratio = canary.value / baseline.value
    if 'max' in t.get('relative', {}) and ratio > t['relative']['max'] and p < alpha:
        return 'fail-relative'   # only when significant
    return 'pass'

Full runnable implementation (compare_proportions, compare_latencies, and the promote/pause/rollback classification): scripts/canary_verdict.py.

alpha = 0.05 is convention; use 0.01 for high-criticality metrics. Skip relative checks when not significant - otherwise random variance triggers false rollbacks.

Step 4 - Observation window

Default: 30 minutes. Pattern:

Window Use
5 min Smoke check only - sanity; not the promote gate.
15 min Low-traffic services where 30 min wouldn't add sample size.
30 min Default for most services.
1 hour High-variance metrics (sparse business KPIs).
2 hour Pre-major-release; matches the team's release-engineering runbook.

Per canary-release: the observation window is "early warning for potential problems before impacting your entire production infrastructure or user base." Longer = more signal, slower release.

Step 5 - Per-traffic-share scaling

Canary at 5% traffic with N requests/min collects 1/20 the sample o

Полный SKILL.md на GitHub

Установить prod-canary-validator в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

.tessl-plugin/plugin.jsonreferences/canary-thresholds.ymlscripts/canary_verdict.py

FAQ

Что делает скилл prod-canary-validator?

Use when a canary deploy needs an automatic promote or rollback decision instead of someone watching dashboards. Compares the canary's error rate, p50, p95 and p99 latency and business KPIs with the baseline over the observation window, with absolute and relative thresholds and a significance check.

Как установить скилл prod-canary-validator?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл prod-canary-validator запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить prod-canary-validator с