[SLOs] Allow slo query wild card filters !!#213119
Merged
shahzad31 merged 5 commits intoelastic:mainfrom Mar 6, 2025
Merged
Conversation
kdelemme
reviewed
Mar 4, 2025
| try { | ||
| if (kqlQuerySchema.is(kuery)) { | ||
| return toElasticsearchQuery(fromKueryExpression(kuery)); | ||
| return toElasticsearchQuery(fromKueryExpression(kuery), dataView); |
Contributor
There was a problem hiding this comment.
As we talked during our meeting, do you think it makes sense to use only buildEsQuery?
Contributor
|
Pinging @elastic/obs-ux-management-team (Team:obs-ux-management) |
kdelemme
approved these changes
Mar 5, 2025
Contributor
kdelemme
left a comment
There was a problem hiding this comment.
LGTM! Appreciate the added tests and the simplification of the code path
Contributor
💔 Build Failed
Failed CI StepsMetrics [docs]
History |
kdelemme
approved these changes
Mar 6, 2025
Contributor
kdelemme
left a comment
There was a problem hiding this comment.
snaps update looks fine
Contributor
|
Starting backport for target branches: 8.16, 8.17, 8.18, 8.x, 9.0 |
kibanamachine
pushed a commit
to kibanamachine/kibana
that referenced
this pull request
Mar 6, 2025
## 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)
Contributor
kibanamachine
added a commit
that referenced
this pull request
Mar 6, 2025
# 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":"shahzad31comp@gmail.com"},"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 <shahzad31comp@gmail.com>
CAWilson94
pushed a commit
to CAWilson94/kibana
that referenced
this pull request
Mar 22, 2025
## 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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: