Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion netra/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion netra/session_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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:
Expand Down