grafana/pkg/services/ngalert/migration
Matthew Jacobson 0424d44b39
Alerting: In migration, create one label per channel (#76527)
* In migration, create one label per channel

This PR changes how routing is done by the legacy alerting migration.

Previously, we created a single label on each alert rule that contained an array of contact point names. Ex: __contact__="slack legacy testing","slack legacy testing2"

This label was then routed against a series of regex-matching policies with continue=true. Ex: __contacts__ =~ .*"slack legacy testing".*

In the case of many contact points, this array could quickly become difficult to manage and difficult to grok at-a-glance.

This PR replaces the single __contact__ label with multiple __legacy_c_{contactname}__ labels and simple equality-matching policies. These channel-specific policies are nested in a single route under the top-level route which matches against __legacy_use_channels__ = true for ease of organization.

This should improve the experience for users wanting to keep the default migrated routing strategy but who also want to modify which contact points an alert sends to.
2023-12-19 13:25:13 -05:00
..
models Alerting: In migration, create one label per channel (#76527) 2023-12-19 13:25:13 -05:00
store Alerting: In migration, create one label per channel (#76527) 2023-12-19 13:25:13 -05:00
alert_rule_test.go Alerting: In migration, create one label per channel (#76527) 2023-12-19 13:25:13 -05:00
alert_rule.go Alerting: In migration, create one label per channel (#76527) 2023-12-19 13:25:13 -05:00
channel_test.go Alerting: In migration, create one label per channel (#76527) 2023-12-19 13:25:13 -05:00
channel.go Alerting: In migration, create one label per channel (#76527) 2023-12-19 13:25:13 -05:00
cond_trans_test.go Alerting: In migration, create one label per channel (#76527) 2023-12-19 13:25:13 -05:00
cond_trans.go Alerting: In migration, create one label per channel (#76527) 2023-12-19 13:25:13 -05:00
migration_test.go Alerting: In migration, create one label per channel (#76527) 2023-12-19 13:25:13 -05:00
models.go Alerting: In migration, create one label per channel (#76527) 2023-12-19 13:25:13 -05:00
permissions_test.go Alerting: In migration, create one label per channel (#76527) 2023-12-19 13:25:13 -05:00
permissions.go Alerting: In migration, create one label per channel (#76527) 2023-12-19 13:25:13 -05:00
securejsondata.go Alerting: Move legacy alert migration from sqlstore migration to service (#72702) 2023-10-12 13:43:10 +01:00
service_test.go Alerting: Add clean_upgrade config and deprecate force_migration (#78324) 2023-11-30 11:01:11 -05:00
service.go Alerting: Add clean_upgrade config and deprecate force_migration (#78324) 2023-11-30 11:01:11 -05:00
silences.go Alerting: Handle custom dashboard permissions in migration service (#74504) 2023-10-12 18:12:40 -04:00
template_test.go Alerting: Handle edge cases without panicking during template migration (#76890) 2023-11-02 13:24:54 -04:00
template.go Alerting: Handle edge cases without panicking during template migration (#76890) 2023-11-02 13:24:54 -04:00
testing.go Alerting: Fix flaky SQLITE_BUSY when migrating with provisioned dashboards (#76658) 2023-10-19 10:03:00 -04:00
ualert_test.go Alerting: In migration improve deduplication of title and group (#78351) 2023-11-29 10:05:00 -05:00
ualert.go Alerting: In migration, create one label per channel (#76527) 2023-12-19 13:25:13 -05:00