Alerting: Remove ngalert feature toggle and introduce two new settings for enabling Grafana 8 alerts and disabling them for specific organisations (#38746)
* Remove `ngalert` feature toggle * Update frontend Remove all references of ngalert feature toggle * Update docs * Disable unified alerting for specific orgs * Add backend tests * Apply suggestions from code review Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com> * Disabled unified alerting by default * Ensure backward compatibility with old ngalert feature toggle * Apply suggestions from code review Co-authored-by: gotjosh <josue@grafana.com>
This commit is contained in:
co-authored by
achatterjee-grafana
gotjosh
parent
2dedbcd3c3
commit
012d4f0905
@@ -49,10 +49,8 @@ func AddDashAlertMigration(mg *migrator.Migrator) {
|
||||
|
||||
_, migrationRun := logs[migTitle]
|
||||
|
||||
ngEnabled := mg.Cfg.IsNgAlertEnabled()
|
||||
|
||||
switch {
|
||||
case ngEnabled && !migrationRun:
|
||||
case mg.Cfg.UnifiedAlerting.Enabled && !migrationRun:
|
||||
// Remove the migration entry that removes all unified alerting data. This is so when the feature
|
||||
// flag is removed in future the "remove unified alerting data" migration will be run again.
|
||||
mg.AddMigration(fmt.Sprintf(clearMigrationEntryTitle, rmMigTitle), &clearMigrationEntry{
|
||||
@@ -67,7 +65,7 @@ func AddDashAlertMigration(mg *migrator.Migrator) {
|
||||
portedChannelGroupsPerOrg: make(map[int64]map[string]string),
|
||||
silences: make(map[int64][]*pb.MeshSilence),
|
||||
})
|
||||
case !ngEnabled && migrationRun:
|
||||
case !mg.Cfg.UnifiedAlerting.Enabled && migrationRun:
|
||||
// Remove the migration entry that creates unified alerting data. This is so when the feature
|
||||
// flag is enabled in the future the migration "move dashboard alerts to unified alerting" will be run again.
|
||||
mg.AddMigration(fmt.Sprintf(clearMigrationEntryTitle, migTitle), &clearMigrationEntry{
|
||||
@@ -92,7 +90,7 @@ func RerunDashAlertMigration(mg *migrator.Migrator) {
|
||||
cloneMigTitle := fmt.Sprintf("clone %s", migTitle)
|
||||
|
||||
_, migrationRun := logs[cloneMigTitle]
|
||||
ngEnabled := mg.Cfg.IsNgAlertEnabled()
|
||||
ngEnabled := mg.Cfg.UnifiedAlerting.Enabled
|
||||
|
||||
switch {
|
||||
case ngEnabled && !migrationRun:
|
||||
|
||||
Reference in New Issue
Block a user