Skip to content

Commit 94c5aac

Browse files
committed
meh
1 parent 734323e commit 94c5aac

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

sentry_sdk/scope.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,15 +1043,18 @@ def start_transaction(
10431043
sampling_context.update(custom_sampling_context)
10441044
transaction._set_initial_sampling_decision(sampling_context=sampling_context)
10451045

1046-
# update the sample rate in the dsc. the baggage should be immutable
1047-
# at this point, but in order to not have broken traces we make
1048-
# an exception here
1046+
# update the sample rate in the dsc
10491047
propagation_context = self.get_active_propagation_context()
10501048
if propagation_context and transaction.sample_rate is not None:
10511049
dsc = propagation_context.dynamic_sampling_context
10521050
if dsc is not None:
10531051
dsc["sample_rate"] = str(transaction.sample_rate)
10541052

1053+
if transaction._baggage:
1054+
dsc = transaction._baggage.sentry_items["sample_rate"] = str(
1055+
transaction.sample_rate
1056+
)
1057+
10551058
if transaction.sampled:
10561059
profile = Profile(
10571060
transaction.sampled, transaction._start_timestamp_monotonic_ns

0 commit comments

Comments
 (0)