diff --git a/src/langtrace_python_sdk/instrumentation/openai/patch.py b/src/langtrace_python_sdk/instrumentation/openai/patch.py index 3718e149..ed2592ad 100644 --- a/src/langtrace_python_sdk/instrumentation/openai/patch.py +++ b/src/langtrace_python_sdk/instrumentation/openai/patch.py @@ -114,6 +114,9 @@ def traced_method( return StreamWrapper(response, span) else: _set_openai_agentic_response_attributes(span, response) + + span.set_status(StatusCode.OK) + span.end() return response except Exception as err: span.record_exception(err)