Skip to content

Commit 914cfa7

Browse files
committed
Do not change the default value of traces_sample_rate
1 parent a5d0f01 commit 914cfa7

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

sentry_sdk/consts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ def __init__(
551551
debug=None, # type: Optional[bool]
552552
attach_stacktrace=False, # type: bool
553553
ca_certs=None, # type: Optional[str]
554-
traces_sample_rate=0, # type: Optional[float]
554+
traces_sample_rate=None, # type: Optional[float]
555555
traces_sampler=None, # type: Optional[TracesSampler]
556556
profiles_sample_rate=None, # type: Optional[float]
557557
profiles_sampler=None, # type: Optional[TracesSampler]

tests/tracing/test_trace_propagation.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,11 @@ def test_with_incoming_trace_and_trace_propagation_targets_matching(
190190
requests.get("http://example.com")
191191

192192
# CHECK if performance data (a transaction/span) is sent to Sentry
193-
if traces_sample_rate is None or incoming_parent_sampled == "0":
193+
if (
194+
traces_sample_rate is None
195+
or traces_sample_rate == USE_DEFAULT_TRACES_SAMPLE_RATE
196+
or incoming_parent_sampled == "0"
197+
):
194198
assert len(events) == 0
195199
else:
196200
if incoming_parent_sampled == "1" or traces_sample_rate == 1:
@@ -264,7 +268,11 @@ def test_with_incoming_trace_and_trace_propagation_targets_not_matching(
264268
requests.get("http://example.com")
265269

266270
# CHECK if performance data (a transaction/span) is sent to Sentry
267-
if traces_sample_rate is None or incoming_parent_sampled == "0":
271+
if (
272+
traces_sample_rate is None
273+
or traces_sample_rate == USE_DEFAULT_TRACES_SAMPLE_RATE
274+
or incoming_parent_sampled == "0"
275+
):
268276
assert len(events) == 0
269277
else:
270278
if incoming_parent_sampled == "1" or traces_sample_rate == 1:

0 commit comments

Comments
 (0)