[v11.0.x] Alerting: Fix simplified routes '...' groupBy creating invalid routes #86376
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport 533bed6 from #86006
What is this feature?
This bugfix has the following effects to simplified routing
GroupBy
:...
, then the generated route will contain only the special label...
.grafana_folder
andalertname
labels. IfGroupBy
is overridden, any missing required labels will be added during route generation.GroupBy
will have the labels sorted consistently: first the required labels followed by any custom labels in sorted order.Why do we need this feature?
This fixes a bug where selecting
...
as a label for simplified routing group by would generate an invalid route according to upstream standards thus preventing any further AM config saves until the simplified routeGroupBy
...
label was removed.There were a few ways to go about this fix:
GroupBy
with mixed...
and other labels.GroupBy
with mixed...
and other labels.GroupBy
by on save.GroupBy
by on route generation.Option 4. was chosen as the others have the following cons:
With option 4. generated routes stay compatible with external/remote AMs, FE doesn't need to change as we allow mixed '...' with custom labels, and settings we save to db are the same as the ones requested.
In addition, it has the slight benefit of allowing us to hide the internal implementation details of
alertname, grafana_folder
from the user in the future, since we don't need to send them with every FE or TF request.Who is this feature for?
Users of simplified routing.
Which issue(s) does this PR fix?:
Fixes #86005, #84073
Peek.2024-04-11.19-27.webm