Skip to content

Commit 8d456e8

Browse files
committed
Add thread to httplib breadcrumbs
1 parent ee41a63 commit 8d456e8

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

sentry_sdk/integrations/stdlib.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ def putrequest(self, method, url, *args, **kwargs):
107107
data[SPANDATA.HTTP_QUERY] = parsed_url.query
108108
data[SPANDATA.HTTP_FRAGMENT] = parsed_url.fragment
109109

110+
if span.get_attribute(SPANDATA.THREAD_ID) is not None:
111+
data[SPANDATA.THREAD_ID] = span.get_attribute(SPANDATA.THREAD_ID)
112+
if span.get_attribute(SPANDATA.THREAD_NAME) is not None:
113+
data[SPANDATA.THREAD_NAME] = span.get_attribute(SPANDATA.THREAD_NAME)
114+
110115
for key, value in data.items():
111116
span.set_attribute(key, value)
112117

sentry_sdk/tracing.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,8 @@ def __init__(
247247
if status is not None:
248248
self.set_status(status)
249249

250+
self.update_active_thread()
251+
250252
def __eq__(self, other):
251253
# type: (object) -> bool
252254
if not isinstance(other, Span):

0 commit comments

Comments
 (0)