Alerting: Guided legacy alerting upgrade dry-run (#80071)

This PR has two steps that together create a functional dry-run capability for the migration.

By enabling the feature flag alertingPreviewUpgrade when on legacy alerting it will:
    a. Allow all Grafana Alerting background services except for the scheduler to start (multiorg alertmanager, state manager, routes, …).
    b. Allow the UI to show Grafana Alerting pages alongside legacy ones (with appropriate in-app warnings that UA is not actually running).
    c. Show a new “Alerting Upgrade” page and register associated /api/v1/upgrade endpoints that will allow the user to upgrade their organization live without restart and present a summary of the upgrade in a table.
This commit is contained in:
Matthew Jacobson
2024-01-05 18:19:12 -05:00
committed by GitHub
parent 72182e02a4
commit aa03b8f8a7
42 changed files with 7403 additions and 169 deletions
+182 -2
View File
@@ -96,6 +96,20 @@
"title": "AlertManagersResult contains the result from querying the alertmanagers endpoint.",
"type": "object"
},
"AlertPair": {
"properties": {
"alertRule": {
"$ref": "#/definitions/AlertRuleUpgrade"
},
"error": {
"type": "string"
},
"legacyAlert": {
"$ref": "#/definitions/LegacyAlert"
}
},
"type": "object"
},
"AlertQuery": {
"properties": {
"datasourceUid": {
@@ -280,6 +294,23 @@
},
"type": "object"
},
"AlertRuleUpgrade": {
"properties": {
"sendsTo": {
"items": {
"type": "string"
},
"type": "array"
},
"title": {
"type": "string"
},
"uid": {
"type": "string"
}
},
"type": "object"
},
"AlertingFileExport": {
"properties": {
"apiVersion": {
@@ -561,6 +592,20 @@
"title": "Config is the top-level configuration for Alertmanager's config files.",
"type": "object"
},
"ContactPair": {
"properties": {
"contactPoint": {
"$ref": "#/definitions/ContactPointUpgrade"
},
"error": {
"type": "string"
},
"legacyChannel": {
"$ref": "#/definitions/LegacyChannel"
}
},
"type": "object"
},
"ContactPointExport": {
"properties": {
"name": {
@@ -580,6 +625,20 @@
"title": "ContactPointExport is the provisioned file export of alerting.ContactPointV1.",
"type": "object"
},
"ContactPointUpgrade": {
"properties": {
"name": {
"type": "string"
},
"routeMatchers": {
"$ref": "#/definitions/ObjectMatchers"
},
"type": {
"type": "string"
}
},
"type": "object"
},
"ContactPoints": {
"items": {
"$ref": "#/definitions/EmbeddedContactPoint"
@@ -592,6 +651,48 @@
"title": "CounterResetHint contains the known information about a counter reset,",
"type": "integer"
},
"DashboardUpgrade": {
"properties": {
"dashboardId": {
"format": "int64",
"type": "integer"
},
"dashboardName": {
"type": "string"
},
"dashboardUid": {
"type": "string"
},
"error": {
"type": "string"
},
"folderName": {
"type": "string"
},
"folderUid": {
"type": "string"
},
"migratedAlerts": {
"items": {
"$ref": "#/definitions/AlertPair"
},
"type": "array"
},
"newFolderName": {
"type": "string"
},
"newFolderUid": {
"type": "string"
},
"provisioned": {
"type": "boolean"
},
"warning": {
"type": "string"
}
},
"type": "object"
},
"DataLink": {
"description": "DataLink define what",
"properties": {
@@ -1833,6 +1934,41 @@
},
"type": "array"
},
"LegacyAlert": {
"properties": {
"dashboardId": {
"format": "int64",
"type": "integer"
},
"id": {
"format": "int64",
"type": "integer"
},
"name": {
"type": "string"
},
"panelId": {
"format": "int64",
"type": "integer"
}
},
"type": "object"
},
"LegacyChannel": {
"properties": {
"id": {
"format": "int64",
"type": "integer"
},
"name": {
"type": "string"
},
"type": {
"type": "string"
}
},
"type": "object"
},
"LinkTransformationConfig": {
"properties": {
"expression": {
@@ -2209,6 +2345,50 @@
},
"type": "object"
},
"OrgMigrationState": {
"properties": {
"migratedChannels": {
"items": {
"$ref": "#/definitions/ContactPair"
},
"type": "array"
},
"migratedDashboards": {
"items": {
"$ref": "#/definitions/DashboardUpgrade"
},
"type": "array"
},
"orgId": {
"format": "int64",
"type": "integer"
}
},
"type": "object"
},
"OrgMigrationSummary": {
"properties": {
"hasErrors": {
"type": "boolean"
},
"newAlerts": {
"format": "int64",
"type": "integer"
},
"newChannels": {
"format": "int64",
"type": "integer"
},
"newDashboards": {
"format": "int64",
"type": "integer"
},
"removed": {
"type": "boolean"
}
},
"type": "object"
},
"PagerdutyConfig": {
"properties": {
"class": {
@@ -4248,6 +4428,7 @@
"type": "object"
},
"alertGroups": {
"description": "AlertGroups alert groups",
"items": {
"$ref": "#/definitions/alertGroup"
},
@@ -4468,6 +4649,7 @@
"type": "array"
},
"integration": {
"description": "Integration integration",
"properties": {
"lastNotifyAttempt": {
"description": "A timestamp indicating the last attempt to deliver a notification regardless of the outcome.\nFormat: date-time",
@@ -4611,7 +4793,6 @@
"type": "array"
},
"postableSilence": {
"description": "PostableSilence postable silence",
"properties": {
"comment": {
"description": "comment",
@@ -4649,7 +4830,6 @@
"type": "object"
},
"receiver": {
"description": "Receiver receiver",
"properties": {
"active": {
"description": "active",