Health check endpoint for monitoring and orchestration
Used by: - Kubernetes liveness probes (is the service running?) - Kubernetes readiness probes (can the service handle traffic?) - Monitoring systems (Prometheus, Datadog, etc.) - Load balancers (health checks) # Health Criteria The service is considered **healthy** when: - PostgreSQL database is reachable (`SELECT 1` succeeds) - Redis cache is reachable (PING succeeds) # Response Codes - **200 OK**: Service is healthy - **503 Service Unavailable**: Service is unhealthy
Used by:
- Kubernetes liveness probes (is the service running?)
- Kubernetes readiness probes (can the service handle traffic?)
- Monitoring systems (Prometheus, Datadog, etc.)
- Load balancers (health checks)
Health Criteria
The service is considered healthy when:
- PostgreSQL database is reachable (
SELECT 1succeeds) - Redis cache is reachable (PING succeeds)
Response Codes
- 200 OK: Service is healthy
- 503 Service Unavailable: Service is unhealthy
Service is healthy
application/json- response
Health check response schema
database*booleanPostgreSQL connection status
redis*booleanRedis connection status
status*stringOverall service status: "healthy" or "unhealthy"
timestamp*stringCurrent timestamp in RFC3339 format
uptime*integerService uptime in seconds since startup
int640 <= valueversion*stringService version from Cargo.toml
curl -X GET 'https://example.com/health'{
"database": true,
"redis": true,
"status": "string",
"timestamp": "string",
"uptime": 0,
"version": "string"
}