-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Replaces kqlFilter with searchConfiguration and uses Unified Search bar in APM rules #164540
Replaces kqlFilter with searchConfiguration and uses Unified Search bar in APM rules #164540
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
Pinging @elastic/apm-ui (Team:APM) |
Pinging @elastic/actionable-observability (Team: Actionable Observability) |
@@ -119,7 +123,7 @@ export function ErrorCountRuleType(props: Props) { | |||
params.serviceName, | |||
params.errorGroupingKey, | |||
params.groupBy, | |||
params.kqlFilter, | |||
params.searchConfiguration, |
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.
This could be problematic. Before kqlFilter
was a string, so the identity only changes if the string changes - and thus the preview request will only be made when the search query changes. Now, the preview request will be made every time params.searchConfiguration
is defined (happens on every render afaict).
This will fix the problem:
params.searchConfiguration, | |
params.searchConfiguration.query, | |
params.searchConfiguration.kuery, |
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.
I've just seen that query
can be an object, in which case the above won't work
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.
I am not sure I follow. I checked the preview request, it is made only when search query changes. Could you give example of other instances when preview request is made?
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.
This is a general problem when using non-primitives as dependencies. There are various blog posts on the topic:
- https://haybeecodes.hashnode.dev/having-objects-as-dependencies-in-react-useeffect-hook#heading-problem-with-having-objects-as-dependencies
- https://deepscan.io/docs/rules/react-useless-dependency-of-hook
It's not necessarily a problem but it's a foot gun and important to be aware of.
x-pack/plugins/apm/server/routes/alerts/rule_types/error_count/get_error_count_chart_preview.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/apm/server/routes/alerts/rule_types/utils/get_parsed_filtered_query.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/apm/server/routes/alerts/rule_types/error_count/get_error_count_chart_preview.ts
Outdated
Show resolved
Hide resolved
…ar in APM rules (elastic#164540) Fixes elastic#163781 - `kqlFilter` which was string is replaced with `searchConfiguration` - Replaces KQL filter component with Unified Search bar - Removed "Technical Preview" from the "Filter" label (cherry picked from commit b88235a) # Conflicts: # x-pack/test/apm_api_integration/tests/alerts/error_count_threshold.spec.ts # x-pack/test/apm_api_integration/tests/alerts/transaction_duration.spec.ts
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…ar in APM rules (elastic#164540) Fixes elastic#163781 - `kqlFilter` which was string is replaced with `searchConfiguration` - Replaces KQL filter component with Unified Search bar - Removed "Technical Preview" from the "Filter" label (cherry picked from commit b88235a)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
…earch bar in APM rules (#164540) (#164938) # Backport This will backport the following commits from `main` to `8.10`: - [Replaces kqlFilter with searchConfiguration and uses Unified Search bar in APM rules (#164540)](#164540) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Bena Kansara","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-08-26T13:55:05Z","message":"Replaces kqlFilter with searchConfiguration and uses Unified Search bar in APM rules (#164540)\n\nFixes https://github.com/elastic/kibana/issues/163781\r\n\r\n- `kqlFilter` which was string is replaced with `searchConfiguration`\r\n- Replaces KQL filter component with Unified Search bar\r\n- Removed \"Technical Preview\" from the \"Filter\" label","sha":"b88235aafe9b6993ef7bb3918f60c6d8462e9e46","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:APM","release_note:skip","backport:skip","auto-backport","Team: Actionable Observability","v8.10.0","v8.11.0"],"number":164540,"url":"https://github.com/elastic/kibana/pull/164540","mergeCommit":{"message":"Replaces kqlFilter with searchConfiguration and uses Unified Search bar in APM rules (#164540)\n\nFixes https://github.com/elastic/kibana/issues/163781\r\n\r\n- `kqlFilter` which was string is replaced with `searchConfiguration`\r\n- Replaces KQL filter component with Unified Search bar\r\n- Removed \"Technical Preview\" from the \"Filter\" label","sha":"b88235aafe9b6993ef7bb3918f60c6d8462e9e46"}},"sourceBranch":"main","suggestedTargetBranches":["8.10"],"targetPullRequestStates":[{"branch":"8.10","label":"v8.10.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/164540","number":164540,"mergeCommit":{"message":"Replaces kqlFilter with searchConfiguration and uses Unified Search bar in APM rules (#164540)\n\nFixes https://github.com/elastic/kibana/issues/163781\r\n\r\n- `kqlFilter` which was string is replaced with `searchConfiguration`\r\n- Replaces KQL filter component with Unified Search bar\r\n- Removed \"Technical Preview\" from the \"Filter\" label","sha":"b88235aafe9b6993ef7bb3918f60c6d8462e9e46"}}]}] BACKPORT--> Co-authored-by: Bena Kansara <[email protected]>
|
||
const { dataView } = useApmDataView(); | ||
const searchbarPlaceholder = | ||
'Search for APM data… (e.g. service.name: service-1)'; |
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.
Shouldn't we translate this?
Fixes #163781
kqlFilter
which was string is replaced withsearchConfiguration