Fix: Handle exception with large stacktrace without dropping entire item - by removing stacktrace#1806
Conversation
Certain exception type such as `SystemStackError` has long backtrace (thus the stack error) The whole envelope item was dropped due to payload size limit logic This ensures it tries to remove the stacktrace when payload is too large, so that the envelope item won't be dropped = exception still reported
e146277 to
3a37b01
Compare
st0012
left a comment
There was a problem hiding this comment.
I'm not sure if remove the entire stacktrace because that'll leave the error event almost useless. Perhaps leaving 20 frames is more ideal?
If the event is still oversized without breadcrumbs and has only 20 frames, the problem is probably somewhere else.
@sl0thentr0py Wdyt?
|
|
||
| Individual gem's changelog has been deprecated. Please check the [project changelog](https://github.com/getsentry/sentry-ruby/blob/master/CHANGELOG.md). | ||
|
|
||
| ## Unreleased |
There was a problem hiding this comment.
This changelog has been deprecated. Can you update the top-level one instead?
| single_exceptions.each do |single_exception| | ||
| traces = single_exception.dig("stacktrace", "frames") | ||
| if traces && traces.size > 0 | ||
| single_exception.delete("stacktrace") |
There was a problem hiding this comment.
I also don't have an answer for this yet, but I'd like to avoid duplicating all the payload truncation logic because of key types.
There was a problem hiding this comment.
python has some overly general serialization logic that drops fields based on nested hash breadth/depth/byte length logic, but I don't like that so much either because it's really hard to read.
|
|
||
| result = item.to_s | ||
| end | ||
|
|
There was a problem hiding this comment.
I can't comment lower so I just leave it here: we also need to update the message form:
is still oversized without breadcrumbs
to
is still oversized without breadcrumbs and stracktrace
|
@st0012 @PikachuEXE yes I also prefer #1807 (keeping N frames) over removing the entire field. |
|
Closing this in favor of #1807 |
Description
This should fix #1799
Certain exception type such as
SystemStackErrorhas long backtrace (thus the stack error)The whole envelope item was dropped due to payload size limit logic
This ensures it tries to remove the stacktrace when payload is too large, so that the envelope item won't be dropped = exception still reported
Maybe it's better to keep some frames like #1807 instead of removing whole stacktrace