diff --git a/netra/__init__.py b/netra/__init__.py index 5ced201..ec21ebf 100644 --- a/netra/__init__.py +++ b/netra/__init__.py @@ -420,6 +420,7 @@ def record_exception( cls, exception: BaseException, attributes: Optional[Dict[str, Any]] = None, + escaped: Optional[bool] = False, ) -> None: """Record a caught exception on the currently active span. @@ -454,7 +455,7 @@ def process_order(order_id: str) -> str: type(exception), ) return - SessionManager.record_exception(exception, attributes=attributes) + SessionManager.record_exception(exception, attributes=attributes, escaped=escaped) @classmethod def add_conversation(cls, conversation_type: ConversationType, role: str, content: Any) -> None: diff --git a/netra/session_manager.py b/netra/session_manager.py index 6254327..db8bdc1 100644 --- a/netra/session_manager.py +++ b/netra/session_manager.py @@ -520,6 +520,7 @@ def set_attribute_on_root_span(cls, attr_key: str, attr_value: Any) -> None: def record_exception( exception: BaseException, attributes: Optional[Dict[str, Any]] = None, + escaped: Optional[bool] = False, ) -> None: """Record a caught exception on the currently active span. @@ -539,7 +540,7 @@ def record_exception( logger.warning("record_exception: no active recording span to record exception on") return - span.record_exception(exception, attributes=attributes) + span.record_exception(exception, attributes=attributes, escaped=escaped) span.set_status(trace.Status(trace.StatusCode.ERROR, str(exception))) span.set_attribute(f"{Config.LIBRARY_NAME}.error_message", str(exception)) except Exception: