Incident response process diagram, drawn from Python
This example is for teams who want their outage steps, and who owns each one, on one page. It shows an invented team's process, from the first alert to the lessons learned, drawn from a 34-line Python script.
Updated
When the site goes down: from alert to lesson learned. Drawn by open-diagram 0.6.2 from examples/incident_response.py: 0 layout problems. Source
The picture as text
When the site goes down: from alert to lesson learned
States shown: Live, Being built, In trial, Planned. Solid lines: data flows today.
Blocks, left to right:
- Detect: Error-rate alerts; Uptime checks; Unusual traffic (in trial). Owner: Reliability team
- Respond: Page the on-call engineer; Open an incident channel; Assign roles automatically (being built). Owner: On-call rotation
- Fix: Roll back; Add servers; Turn off a feature
- Tell people: Status page; Support team; Email affected users (planned)
- Learn: Timeline; Blameless review; Follow-up tasks. Owner: Incident lead
Lines:
- Detect -> Respond
- Respond -> Fix
- Respond -> Tell people, labeled "every 30 min"
- Fix -> Learn
- Tell people -> Learn, labeled "what users saw"
Note: Example. An invented team's process. Every tool and status is made up.What happens, and in what order?
Detect, respond, fix, learn, left to right. Fix and Tell people share a column: both start from Respond and lead to Learn. Three parts are not live yet: unusual traffic alerts are in trial, assigning roles automatically is being built, and emailing affected users is planned.
Which building blocks draw it?
"""How an invented team handles an outage, from the first alert to the lessons learned.
Run: python3 examples/incident_response.py"""
import os
from open_diagram import Diagram, Note, Panel, Tile, Tiles
HERE = os.path.dirname(os.path.abspath(__file__))
def build() -> Diagram:
d = Diagram("When the site goes down: from alert to lesson learned", tag="EXAMPLE",
note=Note("Example", "An invented team's process.", "Every tool and status is made up."))
(detect,), (respond,), (fix, tell), (learn,) = d.columns([
[Panel("Detect", Tiles(["Error-rate alerts", "Uptime checks", Tile("Unusual traffic", status="trial")],
cols=1), footer="Owner: Reliability team")],
[Panel("Respond", Tiles(["Page the on-call engineer", "Open an incident channel",
Tile("Assign roles automatically", status="building")], cols=1),
footer="Owner: On-call rotation")],
[Panel("Fix", Tiles(["Roll back", "Add servers", "Turn off a feature"], cols=1)),
Panel("Tell people", Tiles(["Status page", "Support team", Tile("Email affected users", status="planned")],
cols=1), tone="neutral")],
[Panel("Learn", Tiles(["Timeline", "Blameless review", "Follow-up tasks"], cols=1), tone="accent",
footer="Owner: Incident lead")],
], gap=136, row_gap=32, valign="center")
d.link(detect, respond)
d.link(respond, fix)
d.link(respond, tell, label="every 30 min")
d.link(fix, learn)
d.link(tell, learn, label="what users saw")
return d
if __name__ == "__main__":
build().save(os.path.join(HERE, "..", "docs", "images", "incident_response"))d.columns()places four columns. The third has two panels, Fix above Tell people,row_gap=32apart.valign="center"centres the one-panel columns against the taller third column.label="every 30 min"puts a label on a line.tone="accent"gives Learn its yellow header.footer="Owner: Incident lead"names who runs a step. Fix and Tell people have no owner line.
Why are the columns so far apart?
The line labels need the room. Move the columns closer and each label lands on a panel, as in this shorter script with gap=64:
from open_diagram import Diagram, Panel, Tiles
def build():
d = Diagram("When the site goes down")
(respond,), (fix, tell), (learn,) = d.columns([
[Panel("Respond", Tiles(["Page the on-call engineer", "Open an incident channel"], cols=1))],
[Panel("Fix", Tiles(["Roll back", "Add servers"], cols=1)),
Panel("Tell people", Tiles(["Status page", "Support team"], cols=1))],
[Panel("Learn", Tiles(["Timeline", "Blameless review"], cols=1))],
], gap=64, row_gap=32)
d.link(respond, fix)
d.link(respond, tell, label="every 30 min")
d.link(fix, learn)
d.link(tell, learn, label="what users saw")
return d
The check: 4 layout problem(s)
the label 'every 30 min' on line 'Respond' -> 'Tell people' sits on 'Respond'the label 'every 30 min' on line 'Respond' -> 'Tell people' sits on 'Tell people'the label 'what users saw' on line 'Tell people' -> 'Learn' sits on 'Tell people'the label 'what users saw' on line 'Tell people' -> 'Learn' sits on 'Learn'Widen the gap or shorten the labels. With gap=136, as in the example, the same script reports 0 layout problems.
How do I make my own?
Copy examples/incident_response.py and change the steps, tiles and owners to your team's process. With open-diagram installed (pip install open-diagram), run open-diagram check incident_response.py and open-diagram draw incident_response.py.