Alerting: Create fewer contact points on migration (#47291)

* Alerting: Create fewer contact points on migration

Previously a new contact point was created for every unique combination
of channels attached to any legacy alert. This was very hard to maintain,
requiring modifications in every generated contact point.

This change deduplicates the generated contact points to a more
reasonable state. There should now only be one contact point per legacy
channel, and we attached multiple contact points to a route by nesting
them. The sole exception to this is if there were multiple default
legacy channels, in which case we create a redundant contact point
containing all of them used only in the root policy. This allows for a
much simpler notification policy structure.

Co-authored-by: gotjosh <josue.abreu@gmail.com>
This commit is contained in:
Matthew Jacobson
2022-04-26 16:17:30 +02:00
committed by GitHub
co-authored by gotjosh
parent 5f594addbf
commit 0301d956da
7 changed files with 747 additions and 354 deletions
+1
View File
@@ -55,3 +55,4 @@ Scopes must have an order to ensure consistency and ease of search, this helps u
- `grafana_alerting_ticker_last_consumed_tick_timestamp_seconds`
- `grafana_alerting_ticker_next_tick_timestamp_seconds`
- `grafana_alerting_ticker_interval_seconds`
- [ENHANCEMENT] Migration: Migrate each legacy notification channel to its own contact point, use nested routes to reproduce multi-channel alerts #47291