Night Shift — DevOps

Take the on-call shift: read metrics and logs, find the root cause and restore the SLO. 18 levels of incident response, observability and error budgets.

What you learn in this game

You are on the night watch for the desa's letter service. An SLI (service level indicator) is a number that measures the service from the villagers' side: here the p95 response time and the share of requests that fail. The SLO is its target: p95 at most 300 ms and errors at most 1%. p95 is a percentile of one minute: 95% of that minute's requests are faster than it. It is not an average. A 99% SLO means 1% of a month's requests may fail: that is the error budget. Burn rate compares the errors now with what the SLO allows. Burn rate 1 spends the budget in exactly a month, burn rate 100 in seven hours. The pager goes off when the SLO is broken. Read the chalkboard and the paper roll, pick one action, then watch the villagers' lamps: an action that treats the cause lights every lamp again and keeps them lit.

The first question of every incident: what just changed? A deploy, a config, the data, the load. If the metrics turn bad in the very minute of a change, that change is the prime suspect, and undoing it restores the service sooner than hunting for its bug. But a matching minute is not proof. Read the error message too: those are the service's own words about what failed.

Root cause and symptom. Some actions bring the graph down for a while without touching the cause: the cause keeps working, and the graph climbs again. Others remove the cause, and the graph comes down and stays down. If the numbers on the board drop after your action, do not relax yet. Watch a few more minutes: do the lamps stay lit?

The service holds a pool of 10 connections to the database. Little's law gives how many are in use on average: L = λ × W, requests per second (λ) times how long each connection is held (W). While L is under the pool's size, a request gets a connection at once. Once L passes it, a queue grows, and requests that wait too long fail. L can rise for two reasons: more requests, or each request holding its connection longer. The cures differ.

The masking trap. A restart empties the memory, the graph looks healthy, and then the same cause fills it again. You could restart all night without ever closing the incident, while the night's clock runs. Watch the shape of the line: rising slowly, dropping at the restart, rising again at the same slope. That is a sawtooth.

Cache stampede. The bansos list is computed with a few heavy queries, then kept in the cache for a few minutes. While it is cached every reader is served at once. When it expires, readers who arrive before the new computation finishes find nothing, and each of them computes it too. The graph is unmistakable: calm, then a sharp spike at the same spacing, again and again.