diff --git a/cmd/prometheus/main.go b/cmd/prometheus/main.go index 098d155fa..479742343 100644 --- a/cmd/prometheus/main.go +++ b/cmd/prometheus/main.go @@ -57,17 +57,20 @@ func Main() int { } var ( - memStorage = local.NewMemorySeriesStorage(&cfg.storage) - remoteStorage = remote.New(&cfg.remote) - sampleAppender = storage.Fanout{memStorage} - notificationHandler = notification.NewNotificationHandler(&cfg.notification) - targetManager = retrieval.NewTargetManager(sampleAppender) - queryEngine = promql.NewEngine(memStorage, &cfg.queryEngine) + memStorage = local.NewMemorySeriesStorage(&cfg.storage) + remoteStorage = remote.New(&cfg.remote) + sampleAppender = storage.Fanout{memStorage} ) if remoteStorage != nil { sampleAppender = append(sampleAppender, remoteStorage) } + var ( + notificationHandler = notification.NewNotificationHandler(&cfg.notification) + targetManager = retrieval.NewTargetManager(sampleAppender) + queryEngine = promql.NewEngine(memStorage, &cfg.queryEngine) + ) + ruleManager := rules.NewManager(&rules.ManagerOptions{ SampleAppender: sampleAppender, NotificationHandler: notificationHandler,