Connect alert system to failure prediction: 1. Add AlertCallback to HistoryManager: - OnAlert() method to register callbacks - Callbacks invoked when alerts are added - Called outside lock to prevent deadlocks 2. Expose OnAlertHistory() on alerts.Manager: - Pass-through to HistoryManager.OnAlert() - Enables external systems to track alerts 3. Wire pattern detector in router startup: - Register callback when pattern detector is created - Convert alert types to trackable events - Pattern detector now learns from production alerts Now every alert (memory_warning, cpu_critical, etc.) is recorded as a historical event for pattern analysis. The AI can predict: 'High memory usage typically occurs every ~3 days (next expected in ~1 day)' All tests passing. |
||
|---|---|---|
| .. | ||
| alerts.go | ||
| alerts_test.go | ||
| clone_test.go | ||
| concurrency_test.go | ||
| filter_evaluation.go | ||
| filter_evaluation_test.go | ||
| history.go | ||
| history_concurrency_test.go | ||
| history_test.go | ||
| host_dedup_test.go | ||
| offline_toggle_test.go | ||
| per_metric_delay_example_test.go | ||
| quiet_hours_test.go | ||
| threshold_update_test.go | ||
| time_threshold_test.go | ||
| utility_test.go | ||