skip to content

A payments webhook function's 10% canary passed its rollback alarm, yet errors jumped after full promotion; what went wrong, and how would you fix the release checks?

level: seniorimportance: should knowfreq 45%

answer

  1. what did the alarm measure
  2. a small share dilutes
  3. too few calls in the bake
  4. failures that are not errors
  5. per-version and per-event-type

basics

~20 s

The rollback alarm most likely watched the function's combined error rate, which a small canary share dilutes, or the bake saw too few invocations or none of the failing event type. Alarm on the new version's own metrics and cover every event type.

solid answer

~50 s

Start by grouping the bake-period logs by executed version and event type. The usual finding is that the alarm watched the combined error rate: in this scenario a new version failing 20% of its calls adds only about two percentage points at a 10% share, under a 5% threshold. Other causes are a bake with too few invocations, a failure limited to a rare event type that never arrived, or failures the error metric never counted, such as handled errors returned as normal responses or latency high enough to make the sender resend. Fix the checks: alarm on the new version's own error rate and latency, compare it with the old version's, require a minimum invocation count before promotion, send a signed sample of every event type in a pre-traffic check, and add business signals such as rejected payments.

go deeper

for a junior

Recall that a canary alarm only protects a release if it measures the new version, and that rolling back means moving the alias back to the old version.

for a middle

Explain why a small share dilutes a combined error rate, with the arithmetic, and what per-version metrics change about the signal.

for a senior

Show the full diagnosis: logs grouped by version and event type, invocation counts during the bake, and failures the error metric never counted.

for a principal

Discuss the release-check standard a team should enforce for every function: per-version and business alarms, minimum samples and synthetic coverage of each event type.

## The scenario A payments webhook function is released with a canary: 10% of invocations are routed to the new version for a bake period, and a rollback alarm fires if the function's error rate passes 5%. These are the scenario's own figures, not any platform's defaults. The bake passes, the alias moves to full weight, and errors jump. Something in the release checks let a broken version through. Move the alias back first; diagnose second. ## Diagnosis, step by step 1. **Group the bake-period logs by executed version and event type.** Structured logs that carry the version make this one query; without them the two versions cannot be separated after the fact. 2. **Compute the new version's own error rate** for the bake window and compare it with the old version's over the same window. 3. **Check what the alarm measured.** If it watched the combined rate across both versions, a new version failing 20% of its calls adds only about two percentage points at a 10% share, below the 5% threshold. 4. **Count the new version's invocations** during the bake. A quiet period can leave a canary with too few calls to show anything. 5. **Check which failures the metric counts.** Depending on the platform, a handled failure returned as a normal response may not count as a function error at all. The dilution arithmetic is worth doing out loud. The combined error rate is roughly the canary share times the new version's error rate, plus the remaining share times the old version's rate. With a small share, the new version has to fail a very large fraction of its calls before the combined figure crosses a threshold that was tuned for the whole function. So the defect was the alarm's scope, not the size of the canary. ## The usual causes - **Dilution.** An alarm on the combined error rate divides the canary's failures by all traffic, so the smaller the share, the more broken the new version can be before the alarm moves. - **Coverage.** The failure is limited to one event type, such as a refund or dispute notification, that the sender emitted rarely or never during the bake. - **Invisible failures.** The handler catches the exception and returns a response the platform records as a success, or the failure surfaces only in a failure destination or in the sender's retries. - **The wrong signal.** Only errors were watched, while the regression showed up as latency high enough to make the sender time out and resend. ## Fixing the release checks - **Per-version alarms.** Alarm on the new version's own error rate and latency, using the platform's version breakdown or a metric derived from log lines that record the version. - **Relative comparison.** Fail the canary when the new version is clearly worse than the old one over the same window, not only when it crosses an absolute threshold. - **A minimum sample.** Do not promote until the new version has handled a minimum number of invocations; extend the bake or add synthetic traffic when real traffic is thin. - **Event-type coverage.** Add a pre-traffic check that sends a signed sample of every event type to the new version before any real sender reaches it. - **Business signals.** Alarm on rejected payments, signature failures and arrivals at the failure destination, not only on what the platform calls an error. ## Signals compared | Signal | Catches | Misses | |---|---|---| | Combined error rate | A broken version at full traffic | Most canary failures at a small share | | Per-version error rate | Canary failures the platform counts as errors | Handled failures, rare event types | | Business metric per version | Failures returned as normal responses | Event types that never arrived | | Pre-traffic synthetic events | Every event type, before real traffic | Problems that only appear under real volume | ## After the rollback Once the fixed version is live, replay the events that failed, from the failure destination or by asking the sender to resend, and deduplicate on the event id so nothing is processed twice. Then record the gap in the release checks as the incident's real finding: the code defect was one release, but the blind alarm would have let the next defect through as well.

  • Would simply raising the canary share have caught this release?
    Possibly, but at a high price: a larger share means more real payments hit a broken version before anything fires. Scoping the alarm to the new version gives a clear signal at a small share, which is the point of a canary. A larger share also does nothing for an event type that never arrives during the bake.
  • How do you get per-version error rates on a platform whose metrics have no version breakdown?
    Write the executed version into every structured log line, together with the outcome and event type, and build a metric from a log query grouped by version. The rollback alarm then watches that derived metric instead of the platform's combined error count.

  • If the canary alarm stayed green, the new version was healthy.
  • A longer bake on the combined error rate fixes the dilution.
  • Raising the canary share is the only way to make the alarm sensitive.
  • Every failure the handler catches still shows up as a platform error.
  • Per-version metrics require deploying each version as a separate function.