Readiness probe

A readiness probe determines whether an application can currently serve requests by checking the dependencies required for its operation. In this course, GET /readyz checks MySQL, Redis, and Kafka with bounded timeouts and returns HTTP 503 when dependencies are unavailable.

Minimal example

go
ctx, cancel := context.WithTimeout(r.Context(), 500*time.Millisecond)
err := check(ctx)
cancel()
if err != nil {
    http.Error(w, "not ready", http.StatusServiceUnavailable)
}

Learn this concept

Lesson 7.5 · HTTPS health and migration gates