-
-
Notifications
You must be signed in to change notification settings - Fork 4.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
chore(similarity): Add logging for over 30 system frames #81130
Conversation
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.
if we follow the pattern where we raise the exception we can catch and log then, so no need to pass anything extra into the function
if we raise the exception, would we still be able to return the stacktrace string? I chose to do it this way so the grouping logic would not change yet. also this is a temporary metric that we're gathering so we can look at some examples |
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #81130 +/- ##
==========================================
- Coverage 80.34% 80.30% -0.04%
==========================================
Files 7225 7220 -5
Lines 320221 319346 -875
Branches 20781 20779 -2
==========================================
- Hits 257268 256445 -823
+ Misses 62559 62508 -51
+ Partials 394 393 -1 |
@@ -179,18 +179,22 @@ def get_stacktrace_string(data: dict[str, Any]) -> str: | |||
html_frame_count = 0 # for a temporary metric | |||
stacktrace_str = "" | |||
found_non_snipped_context_line = False | |||
is_frames_truncated = False |
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.
Nit:
is_frames_truncated = False | |
are_frames_truncated = False |
or
is_frames_truncated = False | |
were_frames_truncated = False |
or
is_frames_truncated = False | |
is_truncated_stacktrace = False |
etc.
if len(contributing_frames) + frame_count > MAX_FRAME_COUNT: | ||
is_frames_truncated = True |
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.
It might just be unclear variable naming (and not having read through the entire algorithm) which is getting me, but why are we adding contributing frames to all frames?
Also, nit:
Comparisons return a bool, so we can just use that directly.
if len(contributing_frames) + frame_count > MAX_FRAME_COUNT: | |
is_frames_truncated = True | |
is_frames_truncated = len(contributing_frames) + frame_count > MAX_FRAME_COUNT |
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.
we're doing this to see if the length of all the contributing frames we've accumulated so far (either from this current exception or some previous ones) is greater than 30
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.
Okay, so basially contributing_frames
is ones we've already counted and frame_count
is ones we're about to add?
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.
other way around, but yes that's the idea
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.
Got it, thanks for the explanation!
grouping_info = get_grouping_info_from_variants(variants) | ||
mock_logger.info.assert_called_with( | ||
"grouping.similarity.over_threshold_system_only_frames", | ||
extra={ | ||
"project_id": "", | ||
"event_id": "", | ||
"hash": grouping_info["system"]["hash"], | ||
}, | ||
) |
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.
Nit:
grouping_info = get_grouping_info_from_variants(variants) | |
mock_logger.info.assert_called_with( | |
"grouping.similarity.over_threshold_system_only_frames", | |
extra={ | |
"project_id": "", | |
"event_id": "", | |
"hash": grouping_info["system"]["hash"], | |
}, | |
) | |
grouping_info = get_grouping_info_from_variants(variants) | |
grouping_info["event_id"] = 11212012123120120415201309082013 | |
grouping_info["project_id"] = 12311121 | |
mock_logger.info.assert_called_with( | |
"grouping.similarity.over_threshold_system_only_frames", | |
extra={ | |
"project_id": 11212012123120120415201309082013, | |
"event_id": 12311121, | |
"hash": grouping_info["system"]["hash"], | |
}, | |
) |
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.
the case we're testing here is calling get_seer_similar_issues
without modifying grouping_info
first. so the case when this line is called.
this also doesn't work since grouping info is calculated in the function. we could mock it, but I think the other tests cover this.
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.
Ah, I see. Okay, great. If we were doing this for real I might suggest moving adding the info into the grouping info helper itself (then you only have to do it in one place, I think?), but again, since this is temporary, I say 🚢 .
Add logging for events with stacktraces with over 30 system-only frames
Add logging for events with stacktraces with over 30 system-only frames
PR reverted: 7b7e795 |
)" This reverts commit a3dba87. Co-authored-by: jangjodi <[email protected]>
Add logging for events with stacktraces with over 30 system-only frames
)" This reverts commit a3dba87. Co-authored-by: jangjodi <[email protected]>
Add logging for events with stacktraces with over 30 system-only frames