diff --git a/docs/sources/administration/migration-guide/cloud-migration-assistant.md b/docs/sources/administration/migration-guide/cloud-migration-assistant.md index 87a5a47cb5a..71f81928908 100644 --- a/docs/sources/administration/migration-guide/cloud-migration-assistant.md +++ b/docs/sources/administration/migration-guide/cloud-migration-assistant.md @@ -158,6 +158,10 @@ The migration assistant can migrate the majority of Grafana Alerting resources t - Notification policy tree - Notification templates +{{< admonition type="note">}} +The `grafana-default-email` contact point that's provisioned with every new Grafana instance doesn't have a UID by default and won't be migrated unless you edit or update and save it. You do not need to change the contact point for a UID to be generated when saved. +{{< /admonition >}} + This is sufficient to have your Alerting configuration up and running in Grafana Cloud with minimal effort. Migration of Silences is not supported by the migration assistant and needs to be configured manually. Alert History is also not available for migration. diff --git a/pkg/services/cloudmigration/cloudmigrationimpl/snapshot_mgmt_alerts.go b/pkg/services/cloudmigration/cloudmigrationimpl/snapshot_mgmt_alerts.go index 73ff4fd5a7b..9961e1e1a7f 100644 --- a/pkg/services/cloudmigration/cloudmigrationimpl/snapshot_mgmt_alerts.go +++ b/pkg/services/cloudmigration/cloudmigrationimpl/snapshot_mgmt_alerts.go @@ -92,6 +92,12 @@ func (s *Service) getContactPoints(ctx context.Context, signedInUser *user.Signe contactPoints := make([]contactPoint, 0, len(embeddedContactPoints)) for _, embeddedContactPoint := range embeddedContactPoints { + // This happens in the default contact point, and would otherwise fail to migrate because it has no UID. + // If that contact point is edited in any way, an UID is generated. + if embeddedContactPoint.UID == "" { + continue + } + contactPoints = append(contactPoints, contactPoint{ UID: embeddedContactPoint.UID, Name: embeddedContactPoint.Name, diff --git a/pkg/services/cloudmigration/cloudmigrationimpl/snapshot_mgmt_alerts_test.go b/pkg/services/cloudmigration/cloudmigrationimpl/snapshot_mgmt_alerts_test.go index c7a42105dd8..684bba0aefe 100644 --- a/pkg/services/cloudmigration/cloudmigrationimpl/snapshot_mgmt_alerts_test.go +++ b/pkg/services/cloudmigration/cloudmigrationimpl/snapshot_mgmt_alerts_test.go @@ -89,14 +89,12 @@ func TestGetContactPoints(t *testing.T) { }, } - defaultEmailContactPointCount := 1 - createdContactPoints := createContactPoints(t, ctx, s, user) contactPoints, err := s.getContactPoints(ctx, user) require.NoError(t, err) require.NotNil(t, contactPoints) - require.Len(t, contactPoints, len(createdContactPoints)+defaultEmailContactPointCount) + require.Len(t, contactPoints, len(createdContactPoints)) }) }