-
Notifications
You must be signed in to change notification settings - Fork 509
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
fix: Trim long stacktraces #3795
base: master
Are you sure you want to change the base?
Conversation
Only process and send the first 300 stack frames for an error event. This prevents the SDK from causing the program to hang when the SDK captures an error with a very large number of stack frames. Relay anyways [trims events to 250 stack frames](https://github.com/getsentry/relay/blob/aae36669414a1f7c6ef68d5226cb2e96a28f7667/relay-event-normalization/src/trimming.rs#L286), so it is pointless for us to process much beyond that number. Fixes #2764
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.
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 #3795 +/- ##
==========================================
+ Coverage 84.30% 84.32% +0.01%
==========================================
Files 137 137
Lines 14561 14564 +3
Branches 2460 2460
==========================================
+ Hits 12276 12281 +5
+ Misses 1528 1525 -3
- Partials 757 758 +1
|
please make sure that this is trimming from the correct side of the backtrace since there's a lot of weird reverses in the pipeline from SDK -> ingest -> final persisting |
@sl0thentr0py looks like actually this is trimming from the wrong end of the backtrace (the final calls will get trimmed, when in fact, they are probably the most interesting to the user). Thanks for the good catch! The problem is that I don't think there is a straightforward way to iterate the stack trace in the reverse order. Iterating through the entire stack trace to get the last 300 (or other limit) entries, when the stack trace is very large, is not a good idea though, since the slowness causing #2764 seems to stem from the iteration. So, perhaps we can set a larger stack trace limit (e.g. 1000 frames), and if this is exceeded, we would just drop the stack trace completely from the event? What do you think? We should also perhaps confirm which end of the stack trace Relay is trimming. Likely we want to be doing the same thing as them. |
Relay is trimming not the end of the stracktrace but for recursions the middle on a best effort basis. |
Yes, this can be done through the However, this information will not be shown in the UI at the moment. If you want to display this to a user, this needs to be added to the issue details UI. Edit: For the time being, I'd suggest not to do any of this. Since the UI won't show trimmed stack traces and the future of using |
Only process and send the first 300 stack frames for an error event. This prevents the SDK from causing the program to hang when the SDK captures an error with a very large number of stack frames. Relay anyways trims events to 250 stack frames, so it is pointless for us to process much beyond that number.
Fixes #2764