Skip to Content

Engineering5 min

What a failed deploy taught us about health checks

A build that passed every check and still served errors, and the one question we now ask before shifting traffic.

Author
Elin SatoEngineer
Published

On a Tuesday in September a customer deployed a build that passed every check we had. Four minutes later a fifth of their visitors were seeing errors. This is what we missed and what we changed.

What the check asked

Our health check asked one question: does the app answer on / with a 200? The new build did. Its home page was static, and it rendered without touching anything else.

Every other page read from a database, and the build had shipped with the address of a database that no longer existed. The app was up. It just could not do its job.

A health check that only proves the process started is a check of the wrong thing.

The question we ask now

A project can name the path that proves it works, and that path should touch whatever the app cannot live without. Handoff calls it in every region before any traffic moves, and stops the deploy if one region says no.

handoff.toml
[checks]
path = "/health"
timeout = "5s"

Catching what a check cannot

A check still only sees what it asks about. So the shift itself now watches the error rate. Traffic moves to a new deploy one region at a time, and if errors in that region pass the limit set in handoff.toml, the shift reverses on its own.

With both in place, the deploy from September would have stopped before a single visitor reached it. We replayed it to be sure.

See it for yourself

Everything written about here is in the tool. Your first deploy takes a few minutes.

Read the Docs