fix(metrics) Check custom rules are created only for transaction (back-end)#58232
Merged
Merged
Conversation
iambriccardo
left a comment
Contributor
There was a problem hiding this comment.
Is the constraint of our system that a query has to contain event.type:transaction since it's the only way we can reliably infer the dataset from a discover query?
Comment on lines
+274
to
+280
| for searchFilter in searchFilters: | ||
| if searchFilter.key.name == "event.type" and searchFilter.value.value == "transaction": | ||
| transaction_filter = True | ||
| break | ||
| if not transaction_filter: | ||
| return UnsupportedSearchQueryReason.NOT_TRANSACTION_QUERY | ||
| return None |
Contributor
There was a problem hiding this comment.
Are you planning on extending this method? If not, I would simplify it:
Suggested change
| for searchFilter in searchFilters: | |
| if searchFilter.key.name == "event.type" and searchFilter.value.value == "transaction": | |
| transaction_filter = True | |
| break | |
| if not transaction_filter: | |
| return UnsupportedSearchQueryReason.NOT_TRANSACTION_QUERY | |
| return None | |
| for searchFilter in searchFilters: | |
| if searchFilter.key.name == "event.type" and searchFilter.value.value == "transaction": | |
| return None | |
| return UnsupportedSearchQueryReason.NOT_TRANSACTION_QUERY |
Contributor
Author
There was a problem hiding this comment.
Yes, I presume that it will get more complex in time.
iambriccardo
approved these changes
Oct 18, 2023
iambriccardo
left a comment
Contributor
There was a problem hiding this comment.
Is the constraint of our system that a query has to contain event.type:transaction since it's the only way we can reliably infer the dataset from a discover query?
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR changes the
CustomRulesEndpointendpoint to only accept rules for transactions.Previously any rule was accepted although the condition was generated for transactions only.
Resolves #57900