Health Checks & Probes
Production liveness, readiness, and monitoring probes for container orchestrators (Kubernetes, Docker, Cloud Run) and uptime monitoring.
Overview
Ktor-E-Commerce provides dedicated health check endpoints outside the /api/v1 version prefix. These are designed for load balancers, orchestrator readiness probes, and synthetic monitoring without incurring authentication overhead.
Health Check Endpoints
| Method | Endpoint | Purpose | Upstream Checks | Typical HTTP Status |
|---|---|---|---|---|
| GET | /health |
Basic application ping | Application runtime | 200 OK |
| GET | /health/live |
Kubernetes Liveness probe | Application process active | 200 OK |
| GET | /health/ready |
Kubernetes Readiness probe | Database connection pool (SELECT 1) |
200 OK or 503 Service Unavailable |
Endpoint Details
1. Application Liveness
Verifies the JVM process is accepting HTTP traffic. Used by orchestrators to determine whether the container needs a restart.
Request
Response
2. Database Readiness Probe
Executes an active test query (SELECT 1) against the PostgreSQL database connection pool with a 3,000 ms timeout. If the database is unreachable or connection pools are exhausted, the endpoint responds with 503 Service Unavailable so the load balancer temporarily diverts traffic.