Blue-green deploy lab
Instrument metrics and rollout decisions
Metrics for cutover_seconds and postcut_error_rate must distinguish bad input from component failure for release engineer flipping 100% router cut after green smoke.
1Try it yourself
Decision drill
Blue-green deploy desk
Two full environments — swap traffic atomically, revert fast if metrics break.
1/3v2 passes smoke on the idle (blue) environment. Green still serves 100%.
2Learn the idea
Read
Golden signals for this system
Instrument RAG API with complete green/v1 and blue/v2 stacks behind one router so release engineer flipping 100% router cut after green smoke can answer: demand, errors, latency/age, saturation. Emit fields needed by cutover_seconds and postcut_error_rate with bounded labels. Sample successful high-volume traces; keep errors and rollout transitions denser within policy.
Read
Alert path worth paging
Define at least one alert that would fire for BG-SCHEMA-ONESIDE-11, with a for/pending window that survives deploy blips. Missing scrape or missing revision labels must not look like health. Include a trace/log example id format you will actually search.
Read
Implementation artifact
emit cutover_seconds=$SECONDS active=$ACTIVE
Read
Tests for telemetry
Add a unit/integration check that metrics increment on the happy path and on the schema migration applied only on blue — green rollback serves 500s branch. Store machine-readable output in CI artifacts when practical.
Read
Stage depth
Cardinality discipline: tenant and revision are usually enough; raw question text is not a label. Exemplars or trace links beat screenshots alone when debugging BG-SCHEMA-ONESIDE-11. Define who owns alert fatigue review. If you export to a vendor, record retention and access. Synthetic probes should use non-sensitive fixtures and still exercise router → green|blue /v1/rag/answer. Practice the query you will type at 2am once, while calm.
Read
Field notes for `blue-green-lab` / `observability`
Document the exact PromQL or log query in the runbook stub for this service. Verify histograms have buckets around your SLO target. Add a canary synthetic check that exercises the oracle path every few minutes in staging. Confirm that PII redaction happens before export. Track build/version as a label on the golden signals. Delete noisy debug logs before they become accidental product dependencies. In this chapter the product is RAG API with complete green/v1 and blue/v2 stacks behind one router, the human stakeholder is release engineer flipping 100% router cut after green smoke, and the incident id you design against is BG-SCHEMA-ONESIDE-11. Re-state the oracle in your notes — cutover < 30s; rollback restores green with zero dual-write divergence — and keep the invariant visible: blue must pass smoke + /readyz before cut; old green kept warm for 30m rollback. Track cutover_seconds and postcut_error_rate as the scoreboard. Surface under change control: router → green|blue /v1/rag/answer. If you only have forty minutes, finish the fixture for schema migration applied only on blue — green rollback serves 500s before polishing UI. Promotion language stays ternary: promote, hold, or roll back based on evidence, not hope.
Read
Extra rehearsal for Blue-green deploy lab (observability)
Set a timer for twelve minutes and attempt only the observability concerns for Blue-green deploy lab. Speak aloud what release engineer flipping 100% router cut after green smoke would see on success versus on schema migration applied only on blue — green rollback serves 500s. Write three bullet artifacts you must keep: a fixture name tied to BG-SCHEMA-ONESIDE-11, a metric query for cutover_seconds and postcut_error_rate, and the rollback or refuse command for router → green|blue /v1/rag/answer. Then extend the notes with one sentence on how blue must pass smoke + /readyz before cut; old green kept warm for 30m rollback would be violated if you skipped this page. Close by restating the oracle in your own words without looking: cutover < 30s; rollback restores green with zero dual-write divergence.
Go deeper
Before you start
Why this matters
Name the dashboard row or log line release engineer flipping 100% router cut after green smoke opens first during BG-SCHEMA-ONESIDE-11. It must include a correlation id and a bounded label from cutover_seconds and postcut_error_rate. If telemetry is missing, write whether you promote, hold, or roll back — and why hold is the default.
In the wild
See how this idea shows up as a product and a company — then come back to the lesson. Skills transfer across vendors.
Related lessons
Check your understanding
Page assessment
Answer from memory. Completion is saved from this evidence, not from opening the next page.
All responses are required.