[v10.0.x] Alerting: Convert 'Both' type Prometheus queries to 'Range' in migration #70854
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 00d5f7f from #70781
What is this feature?
This feature updates the legacy migration to convert Prometheus queries of type
Both
to typeRange
and log a warning during migration.Why do we need this feature?
Legacy supports alerting on Prometheus queries of type
Both
. This returns a mixed response with two dataframes (TimeSeriesWide
&NumericWide
), however Server Side Expressions and UA does not currently support this type of mixed response.Who is this feature for?
Users of legacy alerting who will be migrating to UA.
Which issue(s) does this PR fix?:
Fixes #70768
Special notes for your reviewer:
There is the possibility to better support migrating this functionality by:
However, relying on a
Both
query instead of multiple conditions to do this in legacy is likelyto be unintentional. In addition, this would require more robust operator precedence in classic conditions.
Given these reasons, we opt to convert them to
Range
queries and log a warning.Please check that: