mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user