feat(metrics): Change rules schema for latest release#41737
Merged
Conversation
andriisoldatenko
approved these changes
Nov 24, 2022
jjbayer
reviewed
Nov 24, 2022
| # When environment is None, it will be mapped to equivalent null in json. | ||
| # When Relay receives a rule with "value": [null] it will match it against events without | ||
| # the environment tag set. | ||
| "value": [boosted_release.environment], |
Member
There was a problem hiding this comment.
When the value in the event is null, EqCondition does not go into the Array branch, so I think we need just the value here:
Suggested change
| "value": [boosted_release.environment], | |
| "value": boosted_release.environment, |
Contributor
Author
There was a problem hiding this comment.
This is why I wanted an ingest folk 👀, they know their baby well.
jjbayer
approved these changes
Nov 25, 2022
jjbayer
left a comment
Member
There was a problem hiding this comment.
I think we can drop the list entirely (see comment). Apart from that, LGTM!
Comment on lines
+116
to
+118
| "value": [boosted_release.environment] | ||
| if boosted_release.environment | ||
| else None, |
Member
There was a problem hiding this comment.
Suggested change
| "value": [boosted_release.environment] | |
| if boosted_release.environment | |
| else None, | |
| "value": boosted_release.environment |
eq also works with a single value, it then goes into this branch:
https://github.com/getsentry/relay/blob/ae0f47aa5d80bf9086f8bef6575c3713eaf428e2/relay-sampling/src/lib.rs#L68
| ] | ||
| assert generate_rules(default_project) == expected | ||
| config_str = json.dumps({"rules": generate_rules(default_project)}) | ||
| validate_sampling_configuration(config_str) |
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 aims at changing the rules schema for latest release boosting rules.
The new schema uses the
eqoperator and thenullvalue instead ofglobandnot.