feat: telemetry alert rules with webhook delivery

core.alert_rules (migration 00012) — heartbeat_silence and error_spike
rules evaluated by a 60s backend ticker. Transition-based firing:
alert.fired on breach, alert.resolved on recovery, both first-class
webhook event types riding the signed dispatcher + realtime stream.
Dashboard manages rules on the Integrations page.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Tomas DvorakandDevin committed 2026-09-24 19:09:19 +02:00
1 parent 345cf7918b
commit 2f4de543a9
28 files changed
+1693 -10

No files matched your search

@@ -38,6 +38,7 @@ type PlatformService struct {
enc *secrets.Encryptor
dispatcher *WebhookDispatcher
scheduler *JobScheduler
alerts *alertEvaluator
}
type BootstrapInput struct {
@@ -230,6 +231,8 @@ func NewPlatformService(repo *repositories.CoreRepository, store *storage.LocalS
s.dispatcher.Start(context.Background())
s.scheduler = NewJobScheduler(repo.Queries(), enc, logger, s.publishEvent)
s.scheduler.Start(context.Background())
s.alerts = newAlertEvaluator(repo.Queries(), s.publishEvent, logger)
s.alerts.Start(context.Background())
}
return s
}
@@ -242,6 +245,9 @@ func (s *PlatformService) Close() {
if s.scheduler != nil {
s.scheduler.Stop()
}
if s.alerts != nil {
s.alerts.Stop()
}
}
// publishEvent fans a domain event out to realtime SSE subscribers and to