Errors captured by automatic instrumentation should have a mechanism so capture data is available, and the popularity of integrations can be determined.
See
|
except Exception as e: |
|
# Set error flag for tools |
|
if handler_type == "tool": |
|
span.set_data(SPANDATA.MCP_TOOL_RESULT_IS_ERROR, True) |
|
sentry_sdk.capture_exception(e) |
|
raise |
and
|
def _handle_error(self, run_id: "UUID", error: "Any") -> None: |
|
with capture_internal_exceptions(): |
|
if not run_id or run_id not in self.span_map: |
|
return |
|
|
|
span_data = self.span_map[run_id] |
|
span = span_data.span |
|
set_span_errored(span) |
|
|
|
sentry_sdk.capture_exception(error, span.scope) |
Errors captured by automatic instrumentation should have a mechanism so capture data is available, and the popularity of integrations can be determined.
See
sentry-python/sentry_sdk/integrations/mcp.py
Lines 425 to 430 in e275c9e
and
sentry-python/sentry_sdk/integrations/langchain.py
Lines 222 to 231 in e275c9e