Overview
Risk Legion includes comprehensive health monitoring to ensure system reliability, performance visibility, and quick issue detection. Health checks are available at multiple levels: API, database, cache, and application.Health Check Endpoints
Primary Health Endpoint
Component Health
Database Health
Redis Health
Implementation
FastAPI Health Endpoint
Docker Health Check
Docker Compose Health Check
Monitoring Stack
Metrics Collection
Risk Legion exposes Prometheus-compatible metrics:Prometheus Configuration
Logging
Structured Logging
Log Format
Log Levels
Alerting
Alert Configuration
Dashboard Metrics
Application Metrics
Infrastructure Metrics
Database Metrics
Error Tracking
Sentry Integration
Error Categorization
Deployment Health
GitHub Actions Health
The CI/CD pipeline includes health verification:Rollback Triggers
Automatic rollback is triggered when:- Health check fails for 3 consecutive checks
- Error rate exceeds 5% for 5 minutes
- Critical alerts remain unresolved
Runbooks
Database Connection Issues
1
Check Connection Pool
Query active connections:
SELECT count(*) FROM pg_stat_activity2
Review Recent Changes
Check deployment history and recent code changes
3
Restart Connection Pool
Restart the application to reset connection pool
4
Scale if Needed
Increase max connections if consistently at capacity
High Latency
1
Check Slow Queries
Review query performance using
EXPLAIN ANALYZE2
Check Resource Usage
Monitor CPU, memory, and I/O metrics
3
Review Cache Hit Rate
Check Redis cache effectiveness
4
Scale Resources
Increase instance size or add replicas
Related Documentation
- Deployment - Deployment procedures
- Architecture Overview - System architecture