Skip to content

Commit b92f3d0

Browse files
committed
.
1 parent f938477 commit b92f3d0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sentry_sdk/_span_batcher.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class SpanBatcher(Batcher["StreamedSpan"]):
1717
# TODO[span-first]: adjust flush/drop defaults
1818
MAX_BEFORE_FLUSH = 1000
1919
MAX_BEFORE_DROP = 1000
20-
MAX_KB_BEFORE_FLUSH = 5 * 1024 # 5 MB
20+
MAX_BYTES_BEFORE_FLUSH = 5 * 1024 * 1024 # 5 MB
2121
FLUSH_WAIT_TIME = 5.0
2222

2323
TYPE = "span"
@@ -70,15 +70,15 @@ def add(self, span: "StreamedSpan") -> None:
7070
return
7171

7272
self._running_size[span.trace_id] += self._estimate_size(span)
73-
if self._running_size[span.trace_id] >= self.MAX_KB_BEFORE_FLUSH:
73+
if self._running_size[span.trace_id] >= self.MAX_BYTES_BEFORE_FLUSH:
7474
self._flush_event.set()
7575
return
7676

7777
@staticmethod
7878
def _estimate_size(item: "StreamedSpan") -> int:
7979
# This is just a quick approximation
8080
span_dict = SpanBatcher._to_transport_format(item)
81-
return len(str(span_dict)) // 1024
81+
return len(str(span_dict))
8282

8383
@staticmethod
8484
def _to_transport_format(item: "StreamedSpan") -> "Any":

0 commit comments

Comments
 (0)