-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[APM] Immediately return terms for unbound queries #74543
Merged
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
fab5944
[APM] Immediately return terms for unbound queries
dgieselaar 3429781
Merge branch 'master' into faster-suggestions
elasticmachine da836e7
Merge branch 'master' into faster-suggestions
elasticmachine b1bf934
Merge branch 'master' into faster-suggestions
elasticmachine dd0bf3f
Merge branch 'master' into faster-suggestions
elasticmachine bf9279b
Merge branch 'master' of github.com:elastic/kibana into faster-sugges…
dgieselaar 4072dbf
Merge branch 'faster-suggestions' of github.com:dgieselaar/kibana int…
dgieselaar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
2 changes: 2 additions & 0 deletions
2
...ck/plugins/apm/server/lib/settings/agent_configuration/__snapshots__/queries.test.ts.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
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.
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.
Not a comment on the actual feasibility of this approach but a general comment about conditional logic in our ES queries.
I think it's useful to co-locate logic that is meant to go together. For instance, if we add this behaviour but choose to delete it again, it'll be much easier if it's co-located (optimize for deletion).
Similarly, if there is an issue with this implementation and somebody (new) has to debug it, it's much easier if all the related lines are co-located so they don't have to study the es query in detail in case there are other places where we handle this behaviour. Additionally it's easier to write a meaningful comment that applies to all of the lines:
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.
Agree that it's easier to understand. I'll need to look into whether TypeScript likes this though. I may need to look for something that has the same sentiment, but also has type-safety.
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.
@sqren this didn't work out for me, TypeScript started complaining. I don't feel it's worth it to add things like @ts-expect-error, so I'll just leave it as is. I did add a comment to explain what it does.
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.
Fair enough. I still thing it would have been worth co-locating it. It's not a big deal in a small query like this but it all adds up. I also don't like
@ts-expect-error
but I do like having a single coherent chunk of logic: