[APM] Don’t include UI filters when fetching a specific transaction#57934
Merged
sorenlouv merged 3 commits intoelastic:masterfrom Feb 19, 2020
Merged
Conversation
When fetching an error sample, the related transaction is also fetched. This transaction should not be filtered by ui filters
sorenlouv
commented
Feb 18, 2020
| transactionId: string; | ||
| traceId: string; | ||
| setup: Setup & SetupTimeRange & SetupUIFilters; | ||
| }) { |
Member
Author
There was a problem hiding this comment.
I converted the function signature to use a destructured object. Therefore the noise.
sorenlouv
commented
Feb 19, 2020
| { term: { [TRACE_ID]: traceId } }, | ||
| { range: rangeFilter(start, end) }, | ||
| ...uiFiltersES | ||
| { range: rangeFilter(start, end) } |
Member
Author
There was a problem hiding this comment.
Reviewer, look here: this is the meat of the PR. ...uiFiltersES was removed.
sorenlouv
commented
Feb 19, 2020
| client: { search: spy } as any, | ||
| internalClient: { search: spy } as any, | ||
| config: new Proxy({}, { get: () => 'myIndex' }) as APMConfig, | ||
| uiFiltersES: [{ term: { 'my.custom.ui.filter': 'foo-bar' } }], |
Member
Author
There was a problem hiding this comment.
Collapsed these for readability and changed term: { 'service.environment': 'prod' } to term: { 'my.custom.ui.filter': 'foo-bar' to make it clear in the snapshots that it's the ui filter value.
sorenlouv
commented
Feb 19, 2020
| let transaction; | ||
| if (transactionId && traceId) { | ||
| transaction = await getTransaction(transactionId, traceId, setup); | ||
| transaction = await getTransaction({ transactionId, traceId, setup }); |
Member
Author
There was a problem hiding this comment.
Using destructuring for consistency with other functions.
Contributor
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
mbondyra
added a commit
to mbondyra/kibana
that referenced
this pull request
Feb 20, 2020
* master: (136 commits) [Visualize] Remove legacy appState in visualize (elastic#57330) Use static time for tsvb rollup test (elastic#57701) [SIEM] Fix ResizeObserver polyfill (elastic#58046) [SIEM][Detection Engine] Fixes return codes where some were rule_id instead of id skip flaky suite (elastic#56816) skip flaky suite (elastic#58059) skip flaky suite (elastic#45348) migrates notification server routes to NP (elastic#57906) Moved all of the show/hide toggles outside of ordered lists. (elastic#57163) [APM] NP Migration - Moves plugin server files out of legacy (elastic#57532) [Maps][Telemetry] Migrate Maps telemetry to NP (elastic#55055) Embeddable add panel examples (elastic#57319) Fix useRequest to support query change (elastic#57723) Allow custom paths in plugin generator (elastic#57766) [SIEM][Case] Merge header components (elastic#57816) [ML] New Platform server shim: update job audit messages routes (elastic#57925) [kbn/optimizer] emit success event from reducer when all bundles cached (elastic#57945) [APM] Don’t include UI filters when fetching a specific transaction (elastic#57934) Upgrade yargs (elastic#57720) skip flaky suite (elastic#57762) (elastic#57997) (elastic#57998) ... # Conflicts: # src/plugins/advanced_settings/public/management_app/components/field/__snapshots__/field.test.tsx.snap # src/plugins/advanced_settings/public/management_app/components/field/field.tsx # x-pack/plugins/translations/translations/ja-JP.json # x-pack/plugins/translations/translations/zh-CN.json
Contributor
|
Tests ok: |
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.
Closes #57855
On the error groups page an error sample and the related transaction is shown. This transaction is currently fetched by id, and filtered by ui filters as usual. However, the ui filters may cause the transaction to not be found, since they are written with the error document in mind, and thus will contain error specific parameters which will never match the transaction. Therefore I suggest to remove the ui filters from the query for fetching the transaction.
As a general rule of thumb I think the ui filters (query bar + local filters) should only affect the primary document type on a page. Thus when the primary document type on a page is X, any secondary data types on the same page should not be filtered by ui filters.
For more details this issue.
Before

After
