Alerting: Dry-run legacy upgrade on startup (#82835)

Adds a feature flag (alertingUpgradeDryrunOnStart) that will dry-run the legacy 
alert upgrade on startup. It is enabled by default.

When on legacy alerting, this feature flag will log the results of the legacy 
alerting upgrade on startup and draw attention to anything in the current legacy 
alerting configuration that will cause issues when the upgrade is eventually 
performed. It acts as a log warning for those where action is required before 
upgrading to Grafana v11 where legacy alerting will be removed.
This commit is contained in:
Matthew Jacobson
2024-02-16 11:29:54 -05:00
committed by GitHub
parent bc8952b9f1
commit dfaf6d1e2e
14 changed files with 150 additions and 74 deletions

View File

@@ -1214,6 +1214,15 @@ var (
HideFromDocs: true,
HideFromAdminPage: true,
},
{
Name: "alertingUpgradeDryrunOnStart",
Description: "When activated in legacy alerting mode, this initiates a dry-run of the Unified Alerting upgrade during each startup. It logs any issues detected without implementing any actual changes.",
FrontendOnly: false,
Stage: FeatureStageGeneralAvailability,
Owner: grafanaAlertingSquad,
RequiresRestart: true,
Expression: "true", // enabled by default
},
}
)

View File

@@ -162,3 +162,4 @@ groupToNestedTableTransformation,preview,@grafana/dataviz-squad,false,false,true
newPDFRendering,experimental,@grafana/sharing-squad,false,false,false
kubernetesAggregator,experimental,@grafana/grafana-app-platform-squad,false,true,false
groupByVariable,experimental,@grafana/dashboards-squad,false,false,false
alertingUpgradeDryrunOnStart,GA,@grafana/alerting-squad,false,true,false
1 Name Stage Owner requiresDevMode RequiresRestart FrontendOnly
162 newPDFRendering experimental @grafana/sharing-squad false false false
163 kubernetesAggregator experimental @grafana/grafana-app-platform-squad false true false
164 groupByVariable experimental @grafana/dashboards-squad false false false
165 alertingUpgradeDryrunOnStart GA @grafana/alerting-squad false true false

View File

@@ -658,4 +658,8 @@ const (
// FlagGroupByVariable
// Enable groupBy variable support in scenes dashboards
FlagGroupByVariable = "groupByVariable"
// FlagAlertingUpgradeDryrunOnStart
// When activated in legacy alerting mode, this initiates a dry-run of the Unified Alerting upgrade during each startup. It logs any issues detected without implementing any actual changes.
FlagAlertingUpgradeDryrunOnStart = "alertingUpgradeDryrunOnStart"
)

View File

@@ -2124,6 +2124,22 @@
"codeowner": "@grafana/plugins-platform-backend",
"requiresRestart": true
}
},
{
"metadata": {
"name": "alertingUpgradeDryrunOnStart",
"resourceVersion": "1708098586429",
"creationTimestamp": "2024-02-15T21:01:16Z",
"annotations": {
"grafana.app/updatedTimestamp": "2024-02-16 15:49:46.429030423 +0000 UTC"
}
},
"spec": {
"description": "When activated in legacy alerting mode, this initiates a dry-run of the Unified Alerting upgrade during each startup. It logs any issues detected without implementing any actual changes.",
"stage": "GA",
"codeowner": "@grafana/alerting-squad",
"requiresRestart": true
}
}
]
}