Documentation Index
Fetch the complete documentation index at: https://docs.grigori.in/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Health API provides endpoints to check the application’s health status and readiness, essential for monitoring and load balancing in production environments.Health Check
Response
Health status of the applicationValues:
healthy, unhealthyCurrent timestamp in ISO 8601 format
Application version
Application uptime in seconds
Response Example
This endpoint always returns
200 OK if the application is running. Use the readiness endpoint for dependency checks.Readiness Check
Response
Readiness status of the applicationValues:
ready, not readyCurrent timestamp in ISO 8601 format
Status of individual service dependencies
Redis connection status
Celery worker availability
File storage system status
OCR providers availability
Response Examples
- Ready
- Not Ready
200 OKService Dependencies
Redis
Redis
Purpose: Task queue and job storageCheck: Connection test with
PING commandCommon Issues:- Redis server not running
- Connection refused
- Authentication failure
- Network connectivity issues
Celery
Celery
Purpose: Background task processingCheck: Worker availability and task queue connectivityCommon Issues:
- No workers running
- Worker process crashed
- Task routing problems
- Memory issues
Storage
Storage
Purpose: File upload and result storageCheck: Directory accessibility and disk spaceCommon Issues:
- Directory permissions
- Disk full
- Mount point issues
- File system errors
OCR Providers
OCR Providers
Purpose: Text extraction from imagesCheck: Provider initialization and model availabilityCommon Issues:
- Missing models
- GPU unavailable
- API key invalid
- Library compatibility
Load Balancer Configuration
- Nginx
- HAProxy
- Kubernetes
Monitoring Integration
Best Practices
Fast Response
Health and readiness checks should respond quickly (< 1 second) to avoid load balancer timeouts.
Dependency Checks
Readiness checks should validate all critical dependencies but avoid expensive operations.
Graceful Degradation
Consider partial readiness states where some non-critical services may be unavailable.
Monitoring Integration
Integrate health checks with monitoring systems for proactive alerting.
Troubleshooting
Health Check Fails
Health Check Fails
Symptoms: Health endpoint returns 5xx error or doesn’t respondCauses:
- Application crashed
- Port not accessible
- Network issues
- Configuration problems
- Check application logs
- Verify port binding
- Test network connectivity
- Restart the application
Readiness Check Fails
Readiness Check Fails
Symptoms: Readiness endpoint returns “not ready” statusCauses:
- Redis connection issues
- Celery workers not running
- Storage system problems
- OCR providers not initialized
- Check individual service status
- Restart failed services
- Verify configuration
- Check resource availability
Intermittent Failures
Intermittent Failures
Symptoms: Health checks pass sometimes, fail other timesCauses:
- Resource exhaustion
- Network instability
- Database connection pooling issues
- Memory leaks
- Monitor resource usage
- Increase timeout values
- Implement retry logic
- Scale resources appropriately
Next Steps
Error Handling
Learn about API error responses and codes
Production Deployment
Deploy with proper health monitoring
Monitoring
Set up comprehensive monitoring
Jobs API
Learn about the main Jobs API