fix: enable automatic exception recording on MCP spans

Remove record_exception=False and set_status_on_exception=False from
create_mcp_client_span. Let OTel handle exception recording and status
setting automatically. The manual set_mcp_span_error calls for tools/call
still correctly set error.type (which OTel's automatic handling doesn't
touch), so tool_error is preserved.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Tao Chen
2026-06-04 15:34:36 -07:00
Unverified
parent 7371bdb1c9
commit ed8a975b5b
@@ -2053,8 +2053,8 @@ def create_mcp_client_span(
with trace.use_span(
span=span,
end_on_exit=True,
record_exception=False,
set_status_on_exception=False,
record_exception=True,
set_status_on_exception=True,
) as current_span:
yield current_span