The simplest health check answers one question: is this process able to accept a connection? That is useful, and it is also much less than most teams assume. An endpoint that returns 200 OK because the HTTP server is still listening will keep sending traffic to a process that cannot reach its database, has lost its credentials, or is stuck behind a full thread pool.
Two questions, two endpoints
Liveness and readiness look similar in a config file and mean different things in an incident.
- Liveness asks whether the process should be restarted. It should check almost nothing: the event loop is responsive, the process is not deadlocked. Restarting because a dependency is down only removes the instance that could have recovered.
- Readiness asks whether this instance should receive traffic. It may check that configuration loaded and that the instance can complete a trivial request. It should have a short timeout and a clear failure mode.
The deep check trap
The instinct is to make the check thorough: database, cache, queue, third-party API. It feels responsible. In practice it couples every instance to every dependency and turns a partial dependency failure into a full outage, because the load balancer removes all instances at once.
A health check that fails when a non-critical dependency is slow is a self-inflicted denial of service.
If a dependency genuinely cannot be served without, check it — but with a tight timeout, a cached result, and a plan for what happens when the check itself is the slowest thing in the system.
Make the answer boring
A good endpoint is cheap, fast, and uninformative to strangers:
- Return within a fixed budget, well below the probe timeout.
- Return
200or503and almost nothing else. No versions, no hostnames, no dependency details. - Never perform writes, migrations, or anything with side effects.
- Do not log every probe at info level; a fleet of probes will drown the log.
Alert on symptoms
A health check is a routing decision, not a monitoring strategy. Users experience latency and errors, so alert on those. The probe exists to keep traffic away from an instance that cannot serve it, and to do so quietly, in seconds, without becoming a second incident of its own.