-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[SLOs] Allow slo query wild card filters !! #213119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| try { | ||
| if (kqlQuerySchema.is(kuery)) { | ||
| return toElasticsearchQuery(fromKueryExpression(kuery)); | ||
| return toElasticsearchQuery(fromKueryExpression(kuery), dataView); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we talked during our meeting, do you think it makes sense to use only buildEsQuery?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kdelemme done !!
|
Pinging @elastic/obs-ux-management-team (Team:obs-ux-management) |
kdelemme
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Appreciate the added tests and the simplification of the code path
💔 Build Failed
Failed CI StepsMetrics [docs]
History |
kdelemme
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
snaps update looks fine
|
Starting backport for target branches: 8.16, 8.17, 8.18, 8.x, 9.0 |
## 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. (cherry picked from commit 33f51f6)
# Backport This will backport the following commits from `main` to `9.0`: - [[SLOs] Allow slo query wild card filters !! (#213119)](#213119) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Shahzad","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-03-06T16:45:23Z","message":"[SLOs] Allow slo query wild card filters !! (#213119)\n\n## Summary\n\nAllow slo query wild card filters when kql filter and dsl filter both\nare used.\n\nFor KQL filter, allowLeadingWildcards was true by default. introduces\nthe ability to use wildcard filters in SLO queries when DSL filters are\nalso used.\n\n### Changes Made\n1. **Updated `getElasticsearchQueryOrThrow` function:**\n- Added support for `dataView` parameter in the `toElasticsearchQuery`\nfunction.\n - Included additional options for `allowLeadingWildcards`.\n- Enhanced error handling to differentiate between invalid KQL and KQL\nqueries with invalid filters.\n\n2. **Test Coverage:**\n- Added new test cases to cover scenarios with wildcard queries and\nfilters.","sha":"33f51f6d6e01638116b6201215f5f2589fc291c6","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","backport:prev-minor","backport:prev-major","Team:obs-ux-management","v9.1.0"],"title":"[SLOs] Allow slo query wild card filters !!","number":213119,"url":"https://github.com/elastic/kibana/pull/213119","mergeCommit":{"message":"[SLOs] Allow slo query wild card filters !! (#213119)\n\n## Summary\n\nAllow slo query wild card filters when kql filter and dsl filter both\nare used.\n\nFor KQL filter, allowLeadingWildcards was true by default. introduces\nthe ability to use wildcard filters in SLO queries when DSL filters are\nalso used.\n\n### Changes Made\n1. **Updated `getElasticsearchQueryOrThrow` function:**\n- Added support for `dataView` parameter in the `toElasticsearchQuery`\nfunction.\n - Included additional options for `allowLeadingWildcards`.\n- Enhanced error handling to differentiate between invalid KQL and KQL\nqueries with invalid filters.\n\n2. **Test Coverage:**\n- Added new test cases to cover scenarios with wildcard queries and\nfilters.","sha":"33f51f6d6e01638116b6201215f5f2589fc291c6"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/213119","number":213119,"mergeCommit":{"message":"[SLOs] Allow slo query wild card filters !! (#213119)\n\n## Summary\n\nAllow slo query wild card filters when kql filter and dsl filter both\nare used.\n\nFor KQL filter, allowLeadingWildcards was true by default. introduces\nthe ability to use wildcard filters in SLO queries when DSL filters are\nalso used.\n\n### Changes Made\n1. **Updated `getElasticsearchQueryOrThrow` function:**\n- Added support for `dataView` parameter in the `toElasticsearchQuery`\nfunction.\n - Included additional options for `allowLeadingWildcards`.\n- Enhanced error handling to differentiate between invalid KQL and KQL\nqueries with invalid filters.\n\n2. **Test Coverage:**\n- Added new test cases to cover scenarios with wildcard queries and\nfilters.","sha":"33f51f6d6e01638116b6201215f5f2589fc291c6"}}]}] BACKPORT--> Co-authored-by: Shahzad <[email protected]>
## 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.
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
Updated
getElasticsearchQueryOrThrowfunction:dataViewparameter in thetoElasticsearchQueryfunction.allowLeadingWildcards.Test Coverage: