Progressive rollout monitoring
Measure the candidate separately
Compare success, error rates, latency distributions and saturation by actual backend version, endpoint and time window. A small canary can fail badly while an aggregate looks normal. In this synthetic window blue has 9 errors in 900 requests (1%), green has 8 in 100 (8%); overall errors are 17 in 1000 (1.7%). A 2% aggregate threshold would miss the candidate failure. Use minimum sample sizes and comparable workload; do not treat these illustrative numbers as universal SLOs.
version requests errors error rate p95blue 900 9 1.0% 120msgreen 100 8 8.0% 240msLog routing and upstream results
Log a bounded set of fields that lets operators compare the assigned cohort with the actual backend, since retries can change the selected address. This HTTP-context log format omits raw cookies, cohort IDs and request bodies. The backend marker should be trusted only as an operational signal from a controlled backend. For multiple attempts, upstream address and timing variables may contain multiple values; parse them accordingly. Do not confuse request latency with upstream response time.
log_format rollout escape=json '{"status":$status,"backend":"$upstream_addr",' '"version":"$upstream_http_x_version",' '"seconds":$request_time}';Define hold and rollback criteria first
A rollout gate is a decision rule, not a replacement for incident judgment. The toy policy below requires readiness, at least 100 candidate requests and acceptable error and p95 latency; an absent or small sample means hold. A readiness loss or clear regression triggers rollback. Compare with baseline and use multiple windows in production. The offline lab exercises this logic, but a real decision also considers business outcomes and error budget.
def decide(ready, requests, errors, p95_ms): if not ready: return "ROLLBACK" if requests < 100: return "HOLD" if errors / requests > 0.02 or p95_ms > 200: return "ROLLBACK" return "ELIGIBLE_FOR_REVIEW"Verify failover and rollback independently
A read-only route can use a bounded retry for a failed upstream, but retries consume time and may mask an unhealthy candidate. The lab intentionally returns 503 from the first backend on a diagnostic route, checks a GET retry and checks that a sent POST is not retried. Rollback restores the stable traffic selector and confirms the marker; it does not reverse database migrations, external side effects or session changes. Preserve evidence and keep monitoring after rollback.
# Inside a read-only proxy location; two upstream peers requiredproxy_next_upstream error timeout http_503;proxy_next_upstream_tries 2;proxy_next_upstream_timeout 2s;Apply what you learned
Practice: Blue serves 2000 requests with 10 errors and p95 110ms. Green serves 200 with 9 errors and p95 230ms. Use the example gates and propose verification. The manual exercise and quiz are staged separately. Related references and the next lesson are listed in the chapter authored map.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Progressive rollout monitoring
Assess progressive delivery and rollback reasoning.
Why separate metrics by version?
What if the candidate sample is too small?
Which log field identifies actual upstream peer?
Why cap read retries?
What does a routing rollback not undo?