Alerting: Introduce state manager config structure (#61249)

This commit is contained in:
Yuri Tseretyan
2023-01-10 16:26:15 -05:00
committed by GitHub
parent bc3ce5760b
commit 86b5fbbf60
5 changed files with 108 additions and 18 deletions
+9 -1
View File
@@ -209,7 +209,15 @@ func (ng *AlertNG) init() error {
if err != nil {
return err
}
stateManager := state.NewManager(ng.Metrics.GetStateMetrics(), appUrl, store, ng.imageService, clk, history)
cfg := state.ManagerCfg{
Metrics: ng.Metrics.GetStateMetrics(),
ExternalURL: appUrl,
InstanceStore: store,
Images: ng.imageService,
Clock: clk,
Historian: history,
}
stateManager := state.NewManager(cfg)
scheduler := schedule.NewScheduler(schedCfg, stateManager)
// if it is required to include folder title to the alerts, we need to subscribe to changes of alert title