mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: Feature toggle to disallow sending alerts externally (#87982)
* Define feature toggle * Implement feature toggle
This commit is contained in:
@@ -250,10 +250,10 @@ func (ng *AlertNG) init() error {
|
||||
clk := clock.New()
|
||||
|
||||
alertsRouter := sender.NewAlertsRouter(ng.MultiOrgAlertmanager, ng.store, clk, appUrl, ng.Cfg.UnifiedAlerting.DisabledOrgs,
|
||||
ng.Cfg.UnifiedAlerting.AdminConfigPollInterval, ng.DataSourceService, ng.SecretsService)
|
||||
ng.Cfg.UnifiedAlerting.AdminConfigPollInterval, ng.DataSourceService, ng.SecretsService, ng.FeatureToggles)
|
||||
|
||||
// Make sure we sync at least once as Grafana starts to get the router up and running before we start sending any alerts.
|
||||
if err := alertsRouter.SyncAndApplyConfigFromDatabase(); err != nil {
|
||||
if err := alertsRouter.SyncAndApplyConfigFromDatabase(initCtx); err != nil {
|
||||
return fmt.Errorf("failed to initialize alerting because alert notifications router failed to warm up: %w", err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user