Skip to content

Commit 92c8d41

Browse files
committed
fix setting trace_id
1 parent 63df412 commit 92c8d41

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sentry_sdk/client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -977,15 +977,15 @@ def _capture_metric(self, metric):
977977
metric["attributes"]["sentry.release"] = release
978978

979979
span = sentry_sdk.get_current_span()
980-
trace_id = "00000000-0000-0000-0000-000000000000"
980+
metric["trace_id"] = "00000000-0000-0000-0000-000000000000"
981981

982982
if span:
983-
metric["trace_id"] = span.trace_id or trace_id
984-
metric["span_id"] = span.span_id or None
983+
metric["trace_id"] = span.trace_id
984+
metric["span_id"] = span.span_id
985985
else:
986986
propagation_context = isolation_scope.get_active_propagation_context()
987987
if propagation_context:
988-
metric["trace_id"] = propagation_context.trace_id or trace_id
988+
metric["trace_id"] = propagation_context.trace_id
989989

990990
if isolation_scope._user is not None:
991991
for metric_attribute, user_attribute in (

0 commit comments

Comments
 (0)