Skip to content

Commit 8d917f5

Browse files
committed
.
1 parent b57ee5e commit 8d917f5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/tracing/test_sampling.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import sentry_sdk
88
from sentry_sdk import start_span, capture_exception
9+
from sentry_sdk.tracing import BAGGAGE_HEADER_NAME
910
from sentry_sdk.tracing_utils import Baggage
1011
from sentry_sdk.utils import logger
1112

@@ -59,9 +60,11 @@ def test_uses_traces_sample_rate_correctly(
5960
):
6061
sentry_init(traces_sample_rate=traces_sample_rate)
6162

62-
baggage = Baggage(sentry_items={"sample_rand": "0.500000"})
63-
root_span = start_span(name="dogpark", baggage=baggage)
64-
assert root_span.sampled is expected_decision
63+
with sentry_sdk.continue_trace(
64+
{BAGGAGE_HEADER_NAME: "sentry-sample_rand=0.500000"}
65+
):
66+
with start_span(name="dogpark") as root_span:
67+
assert root_span.sampled is expected_decision
6568

6669

6770
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)