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
- Write the expected alarm, the expected runbook step, and the expected load for each drill.
- Run one fault at a time in staging or in the lab.
- Record what fired, what failed, and each gap.
- Turn each gap into a work item with an owner.
- 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:
- The expected alarm: which alarm fires, and in which time.
- The expected runbook step: what the on-call engineer or the system does first.
- 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:
- 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.
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 sourceclaim 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 side | detection 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
| option | gain | cost | when it is correct |
|---|---|---|---|
| No drills | No cost now | The first test of an alarm is a real fault. | Never for a product with customers |
| A drill in staging or in the lab | The 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 time | Each result has one cause. | More drills for the same set of faults | As the default |
| Many faults at one time | One drill covers more parts. | You cannot see which fault caused which result. | Only after each single fault passes in its own drill |
| A fixed schedule | The 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 change | The new steps get a test at once. | One more drill to plan | For 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
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.
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
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
| series | drill | value | unit |
|---|---|---|---|
| drills with the expected alarm | supplier down | 5 | drills |
| drills with the expected alarm | pool empty | 5 | drills |
| drills with the expected alarm | broken image, deep check | 5 | drills |
| drills with the expected alarm | broken image, liveness check | 0 | drills |
| median time to recovery | supplier down | 3 | s |
| median time to recovery | pool empty | 1 | s |
| median time to recovery | broken image, deep check | 3 | s |
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
| problem | cause | correction |
|---|---|---|
| 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
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.
Why does a drill inject only one fault at a time?
- Two faults at one time give a record in which you cannot see which fault caused which result.
- One fault is faster to inject.
- 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.
In a drill, the alarm fires, but the runbook names a command that no longer exists. What is this?
- A pass of the drill
- A gap
- A fault of the lab target
answer
b. A gap
A difference between the expected result and the record is a gap.
What does each gap of a drill become?
- A note in the drill record only
- A second drill on the same day
- 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.
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.
| drill | expected alarm | alarm fired | expected runbook step | step worked | expected load on the lab target | recorded load |
|---|---|---|---|---|---|---|
| Supplier down | Supplier refusals in 60 s | yes, in 45 s | Stop the jobs of that supplier | yes | at most 10 requests each second | 31 requests each second |
| Pool empty | Free identities in 60 s | no | Hold the new jobs that use an identity | yes | no change | no change |
| Image broken | Deploy check failed | yes | Keep the old image in service | no: the runbook names an old command | no change | no change |
- Compare each line of the record with the expected result.
- List each gap.
- 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
- Timeouts, retries, and backoff with jitter, Amazon Builders' Library, article, read 2026-11-22
- My model of the drill cycle, the three faults, and the drill program of a collector, 2026-11 (not public).