Skip to content

Commit

Permalink
fix: capture the fully qualified type name for raised exceptions in s…
Browse files Browse the repository at this point in the history
…pans
  • Loading branch information
emdneto committed Apr 5, 2024
1 parent da30869 commit 96941a7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions opentelemetry-sdk/src/opentelemetry/sdk/trace/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -994,9 +994,11 @@ def record_exception(
traceback.format_exception(
type(exception), value=exception, tb=exception.__traceback__
)
)
)
module = exception.__class__.__module__ if exception.__class__.__module__ != "builtins" else ""
exc_type = f"{module}.{exception.__class__.__qualname__}" if module else exception.__class__.__qualname__
_attributes: MutableMapping[str, types.AttributeValue] = {
"exception.type": exception.__class__.__name__,
"exception.type": exc_type,
"exception.message": str(exception),
"exception.stacktrace": stacktrace,
"exception.escaped": str(escaped),
Expand Down

0 comments on commit 96941a7

Please sign in to comment.