Skip to content

Commit 19082e8

Browse files
committed
cleanup
1 parent 11ed72e commit 19082e8

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

sentry_sdk/scope.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,16 +1044,16 @@ def start_transaction(
10441044
transaction._set_initial_sampling_decision(sampling_context=sampling_context)
10451045

10461046
# update the sample rate in the dsc
1047-
propagation_context = self.get_active_propagation_context()
1048-
if propagation_context and transaction.sample_rate is not None:
1049-
dsc = propagation_context.dynamic_sampling_context
1050-
if dsc is not None:
1051-
dsc["sample_rate"] = str(transaction.sample_rate)
1052-
1053-
if transaction._baggage:
1054-
dsc = transaction._baggage.sentry_items["sample_rate"] = str(
1055-
transaction.sample_rate
1056-
)
1047+
if transaction.sample_rate is not None:
1048+
propagation_context = self.get_active_propagation_context()
1049+
if propagation_context:
1050+
dsc = propagation_context.dynamic_sampling_context
1051+
if dsc is not None:
1052+
dsc["sample_rate"] = str(transaction.sample_rate)
1053+
if transaction._baggage:
1054+
transaction._baggage.sentry_items["sample_rate"] = str(
1055+
transaction.sample_rate
1056+
)
10571057

10581058
if transaction.sampled:
10591059
profile = Profile(

0 commit comments

Comments
 (0)