Skip to content
Merged
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
6 changes: 5 additions & 1 deletion ddtrace/debugging/_exception/replay.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,16 @@ def _capture_tb_frame_for_span(
return snapshot is not None

def on_span_exception(
self, span: Span, _exc_type: t.Type[BaseException], exc: BaseException, tb: t.Optional[TracebackType]
self, span: Span, _exc_type: t.Type[BaseException], exc: BaseException, traceback: t.Optional[TracebackType]
) -> None:
if span.get_tag(DEBUG_INFO_TAG) == "true" or not can_capture(span):
# Debug info for span already captured or no budget to capture
return

# Prioritize the traceback from the exception, if available. Some
# frameworks (like celery) may modify the traceback object that is
# passed to the exception handler.
tb = exc.__traceback__ or traceback
chain, exc_id = unwind_exception_chain(exc, tb)
if not chain or exc_id is None:
# No exceptions to capture
Expand Down
5 changes: 5 additions & 0 deletions releasenotes/notes/fix-er-tb-priority-77dc656bdb2c4802.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
fixes:
- |
exception replay: fixed an issue that prevented snapshots from retrieving
local variables from traceback frames from exception thrown by Celery tasks.
Loading