0Pricing
Go Academy · Lesson

Health Checks and Production Tuning

HEALTHCHECK, tini, signal handling in containers

Health check endpoints

A health check endpoint lets load balancers and orchestrators verify the service is alive and ready to serve traffic. Two common kinds: liveness (is it running?) and readiness (can it serve requests?).

Liveness endpoint

Returns 200 OK if the process is alive. A simple always-passing handler — the process being up is sufficient:

mux.HandleFunc("/healthz/live", func(w http.ResponseWriter, r *http.Request) {
    w.WriteHeader(http.StatusOK)
})

All lessons in this course

  1. Multi-Stage Docker Builds for Go
  2. Environment Config and Secrets
  3. Docker Compose for Local Development
  4. Health Checks and Production Tuning
← Back to Go Academy