diff --git a/sentry_sdk/tracing.py b/sentry_sdk/tracing.py index 7f2baba0c9..b97888ca4d 100644 --- a/sentry_sdk/tracing.py +++ b/sentry_sdk/tracing.py @@ -743,6 +743,7 @@ def get_trace_context(self) -> "Any": ) data = {} + data.update(self._flags) thread_id = self._data.get(SPANDATA.THREAD_ID) if thread_id is not None: @@ -1132,7 +1133,7 @@ def get_trace_context(self) -> "Any": trace_context = super().get_trace_context() if self._data: - trace_context["data"] = self._data + trace_context.setdefault("data", {}).update(self._data) return trace_context