Skip to content

Commit 33f51f6

Browse files
authored
[SLOs] Allow slo query wild card filters !! (elastic#213119)
## Summary Allow slo query wild card filters when kql filter and dsl filter both are used. For KQL filter, allowLeadingWildcards was true by default. introduces the ability to use wildcard filters in SLO queries when DSL filters are also used. ### Changes Made 1. **Updated `getElasticsearchQueryOrThrow` function:** - Added support for `dataView` parameter in the `toElasticsearchQuery` function. - Included additional options for `allowLeadingWildcards`. - Enhanced error handling to differentiate between invalid KQL and KQL queries with invalid filters. 2. **Test Coverage:** - Added new test cases to cover scenarios with wildcard queries and filters.
1 parent 263b85a commit 33f51f6

11 files changed

+921
-298
lines changed

x-pack/solutions/observability/plugins/slo/server/services/__snapshots__/get_preview_data.test.ts.snap

+324-108
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/solutions/observability/plugins/slo/server/services/aggregations/__snapshots__/get_timeslice_metric_indicator_aggregation.test.ts.snap

+26-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/solutions/observability/plugins/slo/server/services/summary_search_client/summary_search_client.test.ts

+19-2
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,25 @@ describe('Summary Search Client', () => {
233233
{ term: { spaceId: 'default' } },
234234
{
235235
bool: {
236-
minimum_should_match: 1,
237-
should: [{ range: { summaryUpdatedAt: { gt: 'now-2h' } } }],
236+
filter: [
237+
{
238+
bool: {
239+
minimum_should_match: 1,
240+
should: [
241+
{
242+
range: {
243+
summaryUpdatedAt: {
244+
gt: 'now-2h',
245+
},
246+
},
247+
},
248+
],
249+
},
250+
},
251+
],
252+
must: [],
253+
must_not: [],
254+
should: [],
238255
},
239256
},
240257
],

x-pack/solutions/observability/plugins/slo/server/services/transform_generators/__snapshots__/apm_transaction_duration.test.ts.snap

+31-22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/solutions/observability/plugins/slo/server/services/transform_generators/__snapshots__/apm_transaction_error_rate.test.ts.snap

+31-22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/solutions/observability/plugins/slo/server/services/transform_generators/__snapshots__/histogram.test.ts.snap

+52-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)