grafana/pkg/services/ngalert/migration/store/slim_models.go
Matthew Jacobson aa03b8f8a7
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.
2024-01-05 18:19:12 -05:00

27 lines
706 B
Go

package store
// SlimAlert is a slimmed down version of the legacy alert model.
type SlimAlert struct {
ID int64 `xorm:"id"`
DashboardID int64 `xorm:"dashboard_id"`
PanelID int64 `xorm:"panel_id"`
Name string
}
// SlimAlertRule is a slimmed down version of the alert rule model.
type SlimAlertRule struct {
UID string `xorm:"uid"`
Title string
NamespaceUID string `xorm:"namespace_uid"`
Labels map[string]string
}
// SlimDashboard is a slimmed down version of the dashboard model.
type SlimDashboard struct {
ID int64 `xorm:"id"`
FolderID int64 `xorm:"folder_id"`
UID string `xorm:"uid"`
Title string
Provisioned bool
}