skip to content

reliability engineering for a collection product · lesson 6 of 6 · sources checked 2026-11-30

failure drills for a collector

This lesson shows how to test the alarms and the runbooks of a collector with one planned fault at a time in the lab.

purpose

An alarm that never fired and a runbook that nobody followed can both fail on the day of a real fault. You find these gaps with less cost when you plan the fault yourself, in the lab. Each gap that a drill finds becomes work with an owner, before a customer sees it.

objectives

  1. Write the expected alarm, the expected runbook step, and the expected load for each drill.
  2. Run one fault at a time in staging or in the lab.
  3. Record what fired, what failed, and each gap.
  4. Turn each gap into a work item with an owner.
  5. Make a drill program with three faults and a schedule.

new terms

how it works

A failure drill is a planned injection of one fault in staging or in the lab. It tests the alarms and the runbooks.

A drill is an experiment: it has a hypothesis, one variable, and a small blast radius. For example, the hypothesis is "the alarm on supplier refusals fires in 60 s", and the one variable is the mock supplier.

before the drill: the expected result

Write the expected result before you inject the fault. The expected result has three parts:

  1. The expected alarm: which alarm fires, and in which time.
  2. The expected runbook step: what the on-call engineer or the system does first.
  3. The expected load on the lab target: the requests each second during the fault.

For example, a drill stops a mock supplier. The expected alarm reads the refusals of the supplier and fires in 60 s. The expected step stops the jobs of that supplier. The expected load on the lab target stays under the client rate.

three faults of a collector

I use three faults in the drill program. Each fault is a part of the collector with its own runbook:

  1. Supplier down: a mock supplier refuses each connection.
  2. Pool empty: the pool has no free identity.
  3. Image broken: a new worker image does not start.

Inject one fault at a time. For example, a drill that stops the supplier and empties the pool at one time gives a record that you cannot read. You do not know which fault caused which result.

the supplier-down drill and the retries

status of this section: from a public source

claim of a company An article of one cloud company states that when an overload causes the failures, retries that add load can make the failure worse. It states that such retries can delay the recovery Amazon Builders' Library, source 1.

Thus the supplier-down drill also records the tries at the lab target and at the mock supplier. A rise of the tries during the fault shows a level that retries outside the retry map of Retry budgets and the retry multiplier.

during and after the drill: the record

The record of a drill has one line for each part of the expected result. Each line says what occurred: the alarm fired or not, the step worked or not, and the load that the lab target got.

A difference between the expected result and the record is a gap. For example, in a synthetic drill the alarm fires, but the runbook names a command that no longer exists. That is one gap. It becomes a work item with an owner and a date.

the drill program and the schedule

A drill program lists the drills, the schedule, and the record of each drill. For example, a program can run one drill of each fault each month. It can also run the drill again after each change of the runbook or of the alarm.

A broken-image drill must test the check that the deploy uses. A check that only sees a running process can pass an image that cannot do its work. A deep check runs a test job and sees the failure.

The output of the work is a drill program with a schedule and a record for each drill.

the two sides

automation sidedetection side
A drill finds the alarm that does not fire and the runbook step that fails, before a real fault does.A drill on a lab target shows the load and the pattern that the fault sends to a target. You read the log of the lab target as a defender.

design decisions

optiongaincostwhen it is correct
No drillsNo cost nowThe first test of an alarm is a real fault.Never for a product with customers
A drill in staging or in the labThe fault does not reach a customer or a third-party target.The lab differs from the real system in some parts.As the default
One fault at a timeEach result has one cause.More drills for the same set of faultsAs the default
Many faults at one timeOne drill covers more parts.You cannot see which fault caused which result.Only after each single fault passes in its own drill
A fixed scheduleThe drills do not stop when the team is busy.Some drills find nothing new.For each fault of the program
A drill after each runbook changeThe new steps get a test at once.One more drill to planFor each change of an alarm or a runbook

diagram

the drill cycle for one fault, from the expected result to a work item for each gap

Each drill starts with a written expected result, and each gap that it finds ends as a work item with an owner.source: My model of the drill cycle of a collector

code example

The example is a lab fault injector for the three faults. It changes only mock parts of your own lab: a mock supplier, a lab identity pool, and a lab image.

m56-x07-fault-injector.tstypescript

Inject one lab fault at a time: a mock supplier that refuses each connection, an empty identity pool, or an image that does not start.

// One fault at a time, in the reader's own lab only. All names are synthetic.
type Fault = { part: string; set: Record<string, unknown>; expected: string };

const FAULTS: Record<string, Fault> = {
  "supplier-down": {
    part: "mock supplier",
    set: { refuse_each_connection: true },
    expected: "alarm on supplier refusals; jobs of that supplier stop",
  },
  "pool-empty": {
    part: "lab identity pool",
    set: { free_identities: 0 },
    expected: "alarm on free identities; new jobs that need an identity wait",
  },
  "image-broken": {
    part: "lab image",
    set: { start_command: "missing-entry-point" },
    expected: "deploy check fails; the old image stays in service",
  },
};

const fault = process.argv[2] ?? "";
if (process.argv.length !== 3 || !Object.hasOwn(FAULTS, fault)) {
  console.error(`give one fault: ${Object.keys(FAULTS).join(", ")}`);
  process.exit(1);
}

const plan = {
  fault,
  part: FAULTS[fault].part,
  change: FAULTS[fault].set,
  expected: FAULTS[fault].expected,
  record: { alarm_fired: null, step_ok: null, load_at_lab_target: null },
};
console.log(JSON.stringify(plan, null, 2));

output

The plan of the supplier-down drill as JSON, with three empty fields of the record.

{
  "fault": "supplier-down",
  "part": "mock supplier",
  "change": {
    "refuse_each_connection": true
  },
  "expected": "alarm on supplier refusals; jobs of that supplier stop",
  "record": {
    "alarm_fired": null,
    "step_ok": null,
    "load_at_lab_target": null
  }
}

The output is the plan for the fault supplier-down. The three fields of the record stay empty until the drill runs.

data

results of four lab drills: expected alarm and time to recovery

status of this figure: measured by me

results of four lab drills: expected alarm and time to recoverydrills with the expected alarm (20 drills)supplier down5pool empty5broken image, deep check5broken image, liveness check0unit: drillsmedian time to recovery (15 s)supplier down3pool empty1broken image, deep check3unit: s

source: Lab result of this course: scripted faults injected into a lab stack, local processes; date 2026-11-13; sample of 20; condition: 5 drills for each of 4 drill types, scripted faults, mock suppliers, one shared host. The step that pages a person did not run. The alarms and the runbook are lab designs.

data table
results of four lab drills: expected alarm and time to recovery
seriesdrillvalueunit
drills with the expected alarmsupplier down5drills
drills with the expected alarmpool empty5drills
drills with the expected alarmbroken image, deep check5drills
drills with the expected alarmbroken image, liveness check0drills
median time to recoverysupplier down3s
median time to recoverypool empty1s
median time to recoverybroken image, deep check3s
Panel 1: drills, out of 5 for each type, where the expected alarm fired. Panel 2: median time to recovery. No drill with a liveness check recovered. No person took part. Each count is a count of scripted lab drills.

The chart is a lab result of this course: scripted faults injected into a lab collector, in local processes. The step that calls the on-call engineer did not run.

The chart shows the mechanism of the broken-image drill. A check that only sees a running process lets the broken image pass, and the drill finds that gap.

failure modes

problemcausecorrection
An alarm does not fire on a real fault.Nobody tested the alarm with a planned fault.Run a drill for each alarm of the program, and record if it fires.
A runbook step fails during a real fault.The runbook names a step that no longer works.Follow the runbook in each drill, and write a work item for each step that fails.
A broken image passes the deploy check.The check sees only a running process, not a working job.Use a deep check that runs a test job.
The record of a drill cannot show the cause of a result.The drill injects two faults at one time.Inject one fault at a time.
A gap from a drill is still open at the next drill.The gap has no work item and no owner.Turn each gap into a work item with an owner and a date.

check questions

  1. Write the three parts of the expected result of a drill.

    sample answer

    The expected alarm and its time, the expected runbook step, and the expected load on the lab target during the fault.

  2. Why does a drill inject only one fault at a time?

    1. Two faults at one time give a record in which you cannot see which fault caused which result.
    2. One fault is faster to inject.
    3. A lab can hold only one fault.
    answer

    a. Two faults at one time give a record in which you cannot see which fault caused which result.

    With one fault, each result has one cause. With two faults at one time, you cannot read the record.

  3. In a drill, the alarm fires, but the runbook names a command that no longer exists. What is this?

    1. A pass of the drill
    2. A gap
    3. A fault of the lab target
    answer

    b. A gap

    A difference between the expected result and the record is a gap.

  4. What does each gap of a drill become?

    1. A note in the drill record only
    2. A second drill on the same day
    3. A work item with an owner and a date
    answer

    c. A work item with an owner and a date

    Each gap becomes a work item with an owner, so that it is closed before the next drill.

  5. Name the three faults of the drill program of a collector.

    sample answer

    Supplier down: a mock supplier refuses each connection. Pool empty: the pool has no free identity. Image broken: a new worker image does not start.

exercise

exercise Do this task on paper, with the synthetic drill record below. The record is synthetic, and it describes no real system. Do not send a request to a site.

drillexpected alarmalarm firedexpected runbook stepstep workedexpected load on the lab targetrecorded load
Supplier downSupplier refusals in 60 syes, in 45 sStop the jobs of that supplieryesat most 10 requests each second31 requests each second
Pool emptyFree identities in 60 snoHold the new jobs that use an identityyesno changeno change
Image brokenDeploy check failedyesKeep the old image in serviceno: the runbook names an old commandno changeno change
  1. Compare each line of the record with the expected result.
  2. List each gap.
  3. Write one work item for each gap, with an owner role.
sample answer

The answer uses the synthetic drill record of the task.

There are three gaps. In the supplier-down drill, the lab target got 31 requests each second against the expected 10. A level retries outside the retry map. The work item for the owner of the worker is to find that level and remove its retries.

In the pool-empty drill, the alarm did not fire. The work item for the owner of the alarms is to correct the alarm on free identities.

In the image-broken drill, the runbook names an old command. The work item for the owner of the runbook is to correct the step, and to run the drill again.

sources

  1. Timeouts, retries, and backoff with jitter, Amazon Builders' Library, article, read 2026-11-22
  2. My model of the drill cycle, the three faults, and the drill program of a collector, 2026-11 (not public).