Overview
Health check endpoints provide real-time service health status for monitoring, load balancers, and orchestration systems. Designed for Kubernetes, Cloud Run, and other cloud platforms.Endpoints
GET /health
Primary health check - Returns overall service health. Use this endpoint for:- Load balancer health checks
- Monitoring systems
- General health status
OK
Service is healthy (all checks passed)
Service Unavailable
Service is degraded or unhealthy (one or more checks failed)
GET /health/ready
Readiness probe - Indicates if service is ready to accept traffic. Use this endpoint for:- Kubernetes readiness probes
- Load balancer registration
- Traffic routing decisions
Returns 200 only when all critical dependencies are available. Service may be running but not ready.
OK
Service is ready to accept traffic
Service Unavailable
Service is not ready (dependencies unavailable)
GET /health/live
Liveness probe - Indicates if service is alive and not deadlocked. Use this endpoint for:- Kubernetes liveness probes
- Auto-restart decisions
- Deadlock detection
OK
Service is alive and responsive
Service Unavailable
Service is deadlocked or unresponsive
GET /health/startup
Startup probe - Indicates if service has completed initialization. Use this endpoint for:- Kubernetes startup probes
- Slow-starting applications
- Initial dependency checks
Prevents premature liveness/readiness checks during startup. Useful for services with long initialization.
OK
Service has completed startup
Service Unavailable
Service is still starting up
GET /health/dependencies
Detailed dependency status - Shows health of all external dependencies. Use this endpoint for:- Debugging connectivity issues
- Monitoring dashboards
- Operational visibility
OK
Dependency check completed (may include unhealthy dependencies)
Health Check Responses
Status Values
string
Component is functioning normally
string
Component is operational but with reduced performance
string
Component is not functioning
string
Component status cannot be determined
Component Checks
- LLM Provider
- OpenFGA
- Keycloak
- Redis
Checks:
- API key validity
- Model availability
- Response time < 5s
- Quota availability
- Invalid API key
- Quota exceeded
- Connection timeout
- Model not found
Monitoring Integration
Prometheus
Expose health check metrics:Kubernetes
Complete Probe Configuration:Cloud Run
Debugging Health Issues
Service Shows Unhealthy
Service Shows Unhealthy
Pods Not Ready
Pods Not Ready
Pods Restarting
Pods Restarting
Slow Health Checks
Slow Health Checks
Best Practices
Probe Configuration
Probe Configuration
Startup Probe:
- Use for slow-starting services (>30s initialization)
- Set
failureThresholdto allow sufficient startup time - Disable liveness/readiness until startup succeeds
- Check only critical functionality
- Avoid checking external dependencies (may cause cascade failures)
- Set generous timeouts to avoid false positives
- Use longer
periodSeconds(10-30s) to reduce load
- Check all critical dependencies
- Use short
periodSeconds(5-10s) for fast traffic routing - Allow temporary failures (set appropriate
failureThreshold)
Monitoring
Monitoring
- Monitor health check response times
- Alert on sustained unhealthy status
- Track dependency availability
- Set up dashboards for health metrics
- Use different alert severities (critical vs warning)
Load Balancers
Load Balancers
- Use
/health/readyfor load balancer health checks - Set appropriate check intervals (5-30s)
- Configure healthy/unhealthy thresholds
- Enable connection draining on unhealthy instances
Related Documentation
Kubernetes Deployment
Configure health probes
Monitoring Guide
Set up observability
Troubleshooting
Debug health issues
Production Checklist
Health check requirements
Always Available: Comprehensive health checks ensure your service is monitored and reliable!