Skip to content

The stack trace is missing when an exception is thrown. #3914

@axel584

Description

@axel584

Hi,
I'm using datadog and collect span with some intrumentation (httpx, wsgi), but when an exception is raised, the stacktrace is missing in datadog.
I looked at the instrumentation code and saw that the command span.record_exception(exception) was missing here:

            if exception:
                if span.is_recording() and _report_new(
                    self._sem_conv_opt_in_mode
                ):
                    span.set_attribute(
                        ERROR_TYPE, type(exception).__qualname__
                    )
                    metric_attributes[ERROR_TYPE] = type(
                        exception
                    ).__qualname__

                raise exception.with_traceback(exception.__traceback__)

What do you think? I'm not a coding expert, but if it seems relevant to you, I'd be happy to submit a pull request.

Thanks a lot,

Axel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions