Health Check Endpoints
Monitor the API’s health, readiness, and liveness for deployment orchestration and monitoring.Endpoints Overview
| Endpoint | Purpose | Use Case |
|---|---|---|
/health | Legacy health check | Basic monitoring |
/ready | Readiness probe | Kubernetes readiness |
/live | Liveness probe | Kubernetes liveness |
GET /health
Legacy health endpoint that returns basic API status.Request
Response (200 OK)
GET /ready
Kubernetes readiness probe that performs comprehensive service checks.What It Checks
- Redis connection and availability
- Database connection (when enabled)
- DNS resolution capability
- SMTP connectivity
- API service health
Request
Response (200 OK)
When all services are ready:Response (503 Service Unavailable)
When one or more services are unhealthy:Kubernetes Configuration
GET /live
Kubernetes liveness probe for basic alive status.What It Checks
- API service is running
- HTTP server is responsive
- No deadlocks or hangs
Request
Response (200 OK)
Kubernetes Configuration
Best Practices
Monitoring Setup
Create health check monitors in your monitoring system:Load Balancer Configuration
Use/ready for load balancer health checks:
Deployment Strategy
Use readiness checks for zero-downtime deployments:Troubleshooting
Redis Connection Failed
If/ready returns Redis error:
Cause: Redis is unreachable or down
Solution:
- Check Redis service status
- Verify network connectivity
- Check Redis credentials
- Review firewall rules
DNS Resolution Failed
If/ready returns DNS error:
Cause: DNS server unreachable or misconfigured
Solution:
- Check DNS server configuration
- Verify network DNS settings
- Test DNS resolution manually:
dig @8.8.8.8 google.com
SMTP Connection Failed
If/ready returns SMTP error:
Cause: SMTP port blocked or firewall restriction
Solution:
- Check outbound port 25 is open
- Verify firewall rules allow SMTP
- Test SMTP connectivity:
telnet smtp.gmail.com 25