Skip to content

Commit 4b2147d

Browse files
committed
.
1 parent 6ce081b commit 4b2147d

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

sentry_sdk/traces.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@
3838
P = ParamSpec("P")
3939
R = TypeVar("R")
4040

41-
BAGGAGE_HEADER_NAME = "baggage"
42-
SENTRY_TRACE_HEADER_NAME = "sentry-trace"
43-
4441

4542
BAGGAGE_HEADER_NAME = "baggage"
4643
SENTRY_TRACE_HEADER_NAME = "sentry-trace"
@@ -307,7 +304,6 @@ def __repr__(self) -> str:
307304
f"trace_id={self.trace_id}, "
308305
f"span_id={self.span_id}, "
309306
f"parent_span_id={self._parent_span_id}, "
310-
f"sampled={self.sampled}, "
311307
f"active={self._active})>"
312308
)
313309

@@ -478,6 +474,15 @@ def timestamp(self) -> "Optional[datetime]":
478474
def _is_segment(self) -> bool:
479475
return self._segment is self
480476

477+
def _update_active_thread(self) -> None:
478+
thread_id, thread_name = get_current_thread_meta()
479+
480+
if thread_id is not None:
481+
self.set_attribute(SPANDATA.THREAD_ID, str(thread_id))
482+
483+
if thread_name is not None:
484+
self.set_attribute(SPANDATA.THREAD_NAME, thread_name)
485+
481486
def _dynamic_sampling_context(self) -> "dict[str, str]":
482487
return self._segment._get_baggage().dynamic_sampling_context()
483488

@@ -522,15 +527,6 @@ def _iter_headers(self) -> "Iterator[tuple[str, str]]":
522527
if baggage:
523528
yield BAGGAGE_HEADER_NAME, baggage
524529

525-
def _update_active_thread(self) -> None:
526-
thread_id, thread_name = get_current_thread_meta()
527-
528-
if thread_id is not None:
529-
self.set_attribute(SPANDATA.THREAD_ID, str(thread_id))
530-
531-
if thread_name is not None:
532-
self.set_attribute(SPANDATA.THREAD_NAME, thread_name)
533-
534530
def _get_trace_context(self) -> "dict[str, Any]":
535531
# Even if spans themselves are not event-based anymore, we need this
536532
# to populate trace context on events

0 commit comments

Comments
 (0)