|
38 | 38 | P = ParamSpec("P") |
39 | 39 | R = TypeVar("R") |
40 | 40 |
|
41 | | -BAGGAGE_HEADER_NAME = "baggage" |
42 | | -SENTRY_TRACE_HEADER_NAME = "sentry-trace" |
43 | | - |
44 | 41 |
|
45 | 42 | BAGGAGE_HEADER_NAME = "baggage" |
46 | 43 | SENTRY_TRACE_HEADER_NAME = "sentry-trace" |
@@ -307,7 +304,6 @@ def __repr__(self) -> str: |
307 | 304 | f"trace_id={self.trace_id}, " |
308 | 305 | f"span_id={self.span_id}, " |
309 | 306 | f"parent_span_id={self._parent_span_id}, " |
310 | | - f"sampled={self.sampled}, " |
311 | 307 | f"active={self._active})>" |
312 | 308 | ) |
313 | 309 |
|
@@ -478,6 +474,15 @@ def timestamp(self) -> "Optional[datetime]": |
478 | 474 | def _is_segment(self) -> bool: |
479 | 475 | return self._segment is self |
480 | 476 |
|
| 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 | + |
481 | 486 | def _dynamic_sampling_context(self) -> "dict[str, str]": |
482 | 487 | return self._segment._get_baggage().dynamic_sampling_context() |
483 | 488 |
|
@@ -522,15 +527,6 @@ def _iter_headers(self) -> "Iterator[tuple[str, str]]": |
522 | 527 | if baggage: |
523 | 528 | yield BAGGAGE_HEADER_NAME, baggage |
524 | 529 |
|
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 | | - |
534 | 530 | def _get_trace_context(self) -> "dict[str, Any]": |
535 | 531 | # Even if spans themselves are not event-based anymore, we need this |
536 | 532 | # to populate trace context on events |
|
0 commit comments