feat: add service health monitoring with auto-restart#315
feat: add service health monitoring with auto-restart#315bugman-007 wants to merge 3 commits intoLight-Heart-Labs:mainfrom
Conversation
Lightheartdevs
left a comment
There was a problem hiding this comment.
cmd_monitor is referenced in dream-cli dispatch but the function is never defined — dream monitor will crash at runtime with 'command not found'. Add the cmd_monitor wrapper function to dream-cli. Also, get_compose_flags in health-monitor.sh duplicates logic from dream-cli which will drift.
|
Fixed per reviewer feedback 1. Added missing cmd_monitor function:
2. Deduplicated get_compose_flags:
The monitor command now works correctly: dream monitor start # Start daemon
dream monitor stop # Stop daemon
dream monitor status # Show restart counters
dream monitor check # Run one-time health check |
|
The health monitoring concept is solid. Issues to fix:
|
…shared lib, improve error handling
|
Fixed the missing function and code duplication issues Health monitoring now works end-to-end: Critical fix:
Architecture improvement:
Error handling:
The monitor command now works correctly: Kindly review again. Thanks. |
Summary
Features
Health Monitoring Script (
scripts/health-monitor.sh).health-monitor-statelogs/health-monitor.logCLI Integration
Configuration
Environment variables control behavior:
HEALTH_CHECK_INTERVAL- Seconds between checks (default: 60)MAX_RESTART_ATTEMPTS- Max restarts per service (default: 3)RESTART_COOLDOWN- Seconds between restart attempts (default: 300)Safety Features
Workflow
Start monitoring:
Check status:
dream monitor status # Shows restart counts and last restart timesService fails:
Test plan