diff --git a/sentry_sdk/integrations/stdlib.py b/sentry_sdk/integrations/stdlib.py index 4de3819a77..c764605c45 100644 --- a/sentry_sdk/integrations/stdlib.py +++ b/sentry_sdk/integrations/stdlib.py @@ -305,6 +305,13 @@ def sentry_patched_popen_init( env = None + sentry_sdk.add_breadcrumb( + type="subprocess", + category="subprocess", + message=description, + data={"subprocess.cwd": cwd} if cwd else {}, + ) + span_streaming = has_span_streaming_enabled(sentry_sdk.get_client().options) span: "Union[Span, StreamedSpan]" if span_streaming: diff --git a/sentry_sdk/tracing_utils.py b/sentry_sdk/tracing_utils.py index 989dee8bc6..6c903cd21d 100644 --- a/sentry_sdk/tracing_utils.py +++ b/sentry_sdk/tracing_utils.py @@ -234,14 +234,6 @@ def maybe_create_breadcrumbs_from_span( else: scope.add_breadcrumb(type="http", category="httplib", data=span._data) - elif span.op == "subprocess": - scope.add_breadcrumb( - type="subprocess", - category="subprocess", - message=span.description, - data=span._data, - ) - def _get_frame_module_abs_path(frame: "FrameType") -> "Optional[str]": try: