Skip to content

Commit dcd8b3b

Browse files
authored
ref: Move subprocess breadcrumbs to integration (#7128)
### Description Decouple subprocess breadcrumbs from span data. #### Issues Closes #7068
1 parent 77a68fe commit dcd8b3b

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

sentry_sdk/integrations/stdlib.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,13 @@ def sentry_patched_popen_init(
305305

306306
env = None
307307

308+
sentry_sdk.add_breadcrumb(
309+
type="subprocess",
310+
category="subprocess",
311+
message=description,
312+
data={"subprocess.cwd": cwd} if cwd else {},
313+
)
314+
308315
span_streaming = has_span_streaming_enabled(sentry_sdk.get_client().options)
309316
span: "Union[Span, StreamedSpan]"
310317
if span_streaming:

sentry_sdk/tracing_utils.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -234,14 +234,6 @@ def maybe_create_breadcrumbs_from_span(
234234
else:
235235
scope.add_breadcrumb(type="http", category="httplib", data=span._data)
236236

237-
elif span.op == "subprocess":
238-
scope.add_breadcrumb(
239-
type="subprocess",
240-
category="subprocess",
241-
message=span.description,
242-
data=span._data,
243-
)
244-
245237

246238
def _get_frame_module_abs_path(frame: "FrameType") -> "Optional[str]":
247239
try:

0 commit comments

Comments
 (0)