Alerting: import Grafana alerting package and update usages (#60490)

* update remaining notifiers to use alerting package
This commit is contained in:
Yuri Tseretyan
2022-12-19 10:53:58 -05:00
committed by GitHub
parent 9b21375d78
commit f0cabe14d5
60 changed files with 296 additions and 6472 deletions

View File

@@ -14,8 +14,10 @@ import (
pb "github.com/prometheus/alertmanager/silence/silencepb"
"xorm.io/xorm"
"github.com/grafana/alerting/alerting/notifier/channels"
ngmodels "github.com/grafana/grafana/pkg/services/ngalert/models"
"github.com/grafana/grafana/pkg/services/ngalert/notifier/channels"
ngchannels "github.com/grafana/grafana/pkg/services/ngalert/notifier/channels"
"github.com/grafana/grafana/pkg/services/sqlstore/migrator"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/util"
@@ -499,7 +501,7 @@ func (m *migration) validateAlertmanagerConfig(orgID int64, config *PostableUser
}
return fallback
}
receiverFactory, exists := channels.Factory(gr.Type)
receiverFactory, exists := ngchannels.Factory(gr.Type)
if !exists {
return fmt.Errorf("notifier %s is not supported", gr.Type)
}