Skip to content

Commit 326d88a

Browse files
committed
finish trace id logic
1 parent 5331750 commit 326d88a

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

sentry_sdk/client.py

-3
Original file line numberDiff line numberDiff line change
@@ -886,9 +886,6 @@ def _capture_experimental_log(self, scope, log):
886886

887887
propagation_context = scope.get_active_propagation_context()
888888
if propagation_context is not None:
889-
if propagation_context.dynamic_sampling_context is not None:
890-
headers["trace"] = propagation_context.dynamic_sampling_context
891-
892889
if log["trace_id"] is None:
893890
log["trace_id"] = propagation_context.trace_id
894891

sentry_sdk/scope.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1047,10 +1047,12 @@ def start_transaction(
10471047
}
10481048
sampling_context.update(custom_sampling_context)
10491049
transaction._set_initial_sampling_decision(sampling_context=sampling_context)
1050+
propagation_context = self.get_active_propagation_context()
10501051

1052+
if "trace_id" not in transaction_kwargs:
1053+
transaction.trace_id = propagation_context.trace_id
10511054
# update the sample rate in the dsc
10521055
if transaction.sample_rate is not None:
1053-
propagation_context = self.get_active_propagation_context()
10541056
if propagation_context:
10551057
dsc = propagation_context.dynamic_sampling_context
10561058
if dsc is not None:

0 commit comments

Comments
 (0)