File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,18 @@ class CompressionAlgo(Enum):
82
82
DEFAULT_MAX_BREADCRUMBS = 100
83
83
MATCH_ALL = r".*"
84
84
85
+ MAX_STACK_FRAMES = 300 # type: int
86
+ """The maximum number of stack frames to capture on error events.
87
+
88
+ Relay enforces a limit of 250 frames on the stack trace. See
89
+ https://github.com/getsentry/relay/blob/aae36669414a1f7c6ef68d5226cb2e96a28f7667/relay-event-normalization/src/trimming.rs#L286.
90
+ We use a slightly higher value here; Relay will trim any frames
91
+ beyond its limit.
92
+
93
+ This constant is for internal use only, and it may be changed or removed
94
+ at any time.
95
+ """
96
+
85
97
FALSE_VALUES = [
86
98
"false" ,
87
99
"no" ,
Original file line number Diff line number Diff line change 1
1
import base64
2
+ import itertools
2
3
import json
3
4
import linecache
4
5
import logging
26
27
27
28
import sentry_sdk
28
29
from sentry_sdk ._compat import PY37
29
- from sentry_sdk .consts import DEFAULT_MAX_VALUE_LENGTH , EndpointType
30
+ from sentry_sdk .consts import DEFAULT_MAX_VALUE_LENGTH , MAX_STACK_FRAMES , EndpointType
30
31
31
32
from typing import TYPE_CHECKING
32
33
@@ -803,7 +804,7 @@ def single_exception_from_error_tuple(
803
804
max_value_length = max_value_length ,
804
805
custom_repr = custom_repr ,
805
806
)
806
- for tb in iter_stacks (tb )
807
+ for tb in itertools . islice ( iter_stacks (tb ), MAX_STACK_FRAMES )
807
808
]
808
809
809
810
if frames :
You can’t perform that action at this time.
0 commit comments