File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -91,9 +91,18 @@ def add(self, span: "StreamedSpan") -> None:
9191 @staticmethod
9292 def _estimate_size (item : "StreamedSpan" ) -> int :
9393 # Rough estimate of serialized span size that's quick to compute.
94- # 210 is the rough size of the payload without attributes, and we
95- # estimate additional 70 bytes on top of that per attribute.
96- return 210 + 70 * len (item ._attributes )
94+ # 210 is the rough size of the payload without attributes, and then we
95+ # estimate the attributes separately.
96+ estimate = 210
97+ for value in item ._attributes .values ():
98+ estimate += 7
99+
100+ if isinstance (value , str ):
101+ estimate += len (value )
102+ else :
103+ estimate += len (str (value ))
104+
105+ return estimate
97106
98107 @staticmethod
99108 def _to_transport_format (item : "StreamedSpan" ) -> "Any" :
Original file line number Diff line number Diff line change 1313from sentry_sdk .utils import (
1414 SENSITIVE_DATA_SUBSTITUTE ,
1515 capture_internal_exceptions ,
16- ensure_integration_enabled ,
1716 logger ,
1817 parse_url ,
1918)
You can’t perform that action at this time.
0 commit comments