Skip to content

Commit 5654568

Browse files
authored
Enable backpressure handling by default (#2298)
1 parent fa689eb commit 5654568

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

sentry_sdk/client.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,7 @@ def _capture_envelope(envelope):
224224

225225
self.monitor = None
226226
if self.transport:
227-
if self.options["_experiments"].get(
228-
"enable_backpressure_handling", False
229-
):
227+
if self.options["enable_backpressure_handling"]:
230228
self.monitor = Monitor(self.transport)
231229

232230
self.session_flusher = SessionFlusher(capture_func=_capture_envelope)

sentry_sdk/consts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
# TODO: Remove these 2 profiling related experiments
4040
"profiles_sample_rate": Optional[float],
4141
"profiler_mode": Optional[ProfilerMode],
42-
"enable_backpressure_handling": Optional[bool],
4342
},
4443
total=False,
4544
)
@@ -240,6 +239,7 @@ def __init__(
240239
functions_to_trace=[], # type: Sequence[Dict[str, str]] # noqa: B006
241240
event_scrubber=None, # type: Optional[sentry_sdk.scrubber.EventScrubber]
242241
max_value_length=DEFAULT_MAX_VALUE_LENGTH, # type: int
242+
enable_backpressure_handling=True, # type: bool
243243
):
244244
# type: (...) -> None
245245
pass

tests/test_monitor.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,16 @@ def is_healthy(self):
2121

2222

2323
def test_no_monitor_if_disabled(sentry_init):
24-
sentry_init(transport=HealthyTestTransport())
24+
sentry_init(
25+
transport=HealthyTestTransport(),
26+
enable_backpressure_handling=False,
27+
)
28+
2529
assert Hub.current.client.monitor is None
2630

2731

2832
def test_monitor_if_enabled(sentry_init):
29-
sentry_init(
30-
transport=HealthyTestTransport(),
31-
_experiments={"enable_backpressure_handling": True},
32-
)
33+
sentry_init(transport=HealthyTestTransport())
3334

3435
monitor = Hub.current.client.monitor
3536
assert monitor is not None
@@ -42,10 +43,7 @@ def test_monitor_if_enabled(sentry_init):
4243

4344

4445
def test_monitor_unhealthy(sentry_init):
45-
sentry_init(
46-
transport=UnhealthyTestTransport(),
47-
_experiments={"enable_backpressure_handling": True},
48-
)
46+
sentry_init(transport=UnhealthyTestTransport())
4947

5048
monitor = Hub.current.client.monitor
5149
monitor.interval = 0.1
@@ -64,7 +62,6 @@ def test_transaction_uses_downsampled_rate(
6462
sentry_init(
6563
traces_sample_rate=1.0,
6664
transport=UnhealthyTestTransport(),
67-
_experiments={"enable_backpressure_handling": True},
6865
)
6966

7067
reports = capture_client_reports()

0 commit comments

Comments
 (0)