Health Endpoints
Technical documentation for health monitoring and metrics API endpoints.Available Endpoints
Health Check
GET /health
General Metrics
GET /metrics
Source-Specific Metrics
GET /metrics/{source}
Health Check Endpoint
Request
Response Format
Response Fields
Overall Status
- status: Overall system health (
healthy,degraded,unhealthy) - timestamp: ISO 8601 timestamp of health check
- version: Current API version
- uptime: System uptime in seconds
Component Checks
- checks: Health status of individual components
- details: Detailed information for each component
Component Details
- database: Database connection and performance
- redis: Cache status and memory usage
- external_apis: External API availability and response times
Implementation Examples
Health Check (JavaScript)
Health Check (Python)
Metrics Endpoints
General Metrics
Source-Specific Metrics
Response Headers
Error Handling
HTTP Status Codes
Success Codes
- 200 OK: Request successful
- 207 Multi-Status: Health check with mixed component status
Error Codes
- 401 Unauthorized: Invalid or missing API key
- 404 Not Found: Invalid source or endpoint
- 429 Too Many Requests: Rate limit exceeded
- 503 Service Unavailable: Service temporarily unavailable
Error Response Format
Error Handling Implementation
Rate Limiting
Health Endpoint Limits
- Requests: 60 requests per minute
- Burst: 10 requests per second
- Authentication: Not required
Metrics Endpoint Limits
- Requests: 100 requests per minute per API key
- Burst: 20 requests per second per API key
- Authentication: Required
Rate Limit Headers
Rate Limit Handling
Monitoring and Alerting
Health Monitoring Setup
Best Practices
For Health Checks
- Regular Monitoring: Check health every 1-5 minutes
- Alert Thresholds: Set appropriate alert triggers
- Graceful Degradation: Handle partial system failures
- Documentation: Document all health states and responses
For Metrics
- Authentication: Always include valid API key
- Rate Limiting: Respect rate limits and implement backoff
- Error Handling: Handle all error states gracefully
- Caching: Cache metrics data appropriately
For Integration
- Timeouts: Set appropriate request timeouts
- Retries: Implement exponential backoff for failed requests
- Logging: Log all health checks and metrics requests
- Monitoring: Monitor your monitoring system
For more information about specific metrics, see Performance Metrics and Source-Specific Metrics.