-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(grouping): Make system frames not contribute to app variant (#84382)
When we do grouping based on stacktrace, we actually produce two hashes, one based on the full stacktrace and one based on only the in-app frames. Right now, it's possible for non-app ("system") frames to be included in the app hash if they're subject to a `+group` stacktrace rule. This fixes that by checking the results which come back from the rust enhancer (which is what actually does the application of the stacktrace rules) when we're calculating the app hash and overriding them if necessary, to weed out the rogue system frames. Doing this can change a stacktrace which rust thinks has contributing frames to one which no longer does (and therefore shouldn't contribute to the hash), so we also now check the full stacktrace in the app variant and override its `contributing` value in that case. The effects of this change are easiest to see in the `test_variants/test_event_hash_variant` newstyle snapshots. (The metadata snapshots, because they don't show both app and system variants, do show the correct changes, but in a way which is less intuitive.) - In both inputs[1],[2], the `handleRequest` frame from `router.js` is a system frame which has until now been counted as contributing to the app variant because of the `stack.function:handleRequest -app +group` rule. - In `contributing_system_and_app_frames`, the app variant also has the in-app `playFetch` frame contributing, so even though the app hash changes when the `handleRequest` frame stops contributing, the app variant's stacktrace remains contributing. (Note that the hash change won't actually lead to new groups, since the old hash, which used to match the system hash, is still being produced by the system variant.) (See PR description for a screenshot of the changes) - In `contributing_system_frames`, the only contributing frame the app variant had was the `handleRequest` frame. With it now not contributing, the app variant has no contributing frames, so its stacktrace has switched from contributing to not contributing. (Again here, no new group will be formed because the system hash remains the same.) (See PR description for a screenshot of the changes) The other effect of this change is that it fixes what is currently broken behavior in the `has_too_many_contributing_frames` Seer utility function[3]. Right now, stacktraces like the one in the `contributing_system_frames` test input mistakenly count the app variant as the contributing one, and `contributing_system_frames` therefore looks to see how many in-app contributing frames there are. Frames like the `handleRequest` frame don't count in that tally, because they're not in-app, leading `has_too_many_contributing_frames` to mistakenly let through stacktraces it shouldn't. With this fix, we can stop skipping the `has_too_many_contributing_frames` test demonstrating this[4]. This PR also adds dedicated tests in `test_enhancer.py`. Note: Because the legacy config handles frames and stacktraces differently, this fix is limited to hash calculations using the newstyle configs. [1] https://github.com/getsentry/sentry/blob/e4888e1eb290ab59dff98729f3992551bfe23f3e/tests/sentry/grouping/grouping_inputs/contributing_system_and_app_frames.json [2] https://github.com/getsentry/sentry/blob/e4888e1eb290ab59dff98729f3992551bfe23f3e/tests/sentry/grouping/grouping_inputs/contributing_system_frames.json [3] https://github.com/getsentry/sentry/blob/e4888e1eb290ab59dff98729f3992551bfe23f3e/src/sentry/seer/similarity/utils.py#L320-L379 [4] https://github.com/getsentry/sentry/blob/e4888e1eb290ab59dff98729f3992551bfe23f3e/tests/sentry/seer/similarity/test_utils.py#L1055-L1075
- Loading branch information
1 parent
be1a19d
commit 4b1a3c8
Showing
18 changed files
with
649 additions
and
169 deletions.
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
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
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
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
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
Oops, something went wrong.