Skip to content

Exceptions are not recorded in traces from instrumented Pyramid apps #2619

@rbagd

Description

@rbagd

What problem do you want to solve?

Traces resulting from Pyramid instrumentation do not record server exceptions that have resulted in errored requests. Here is the relevant output part by calling an instrumented Pyramid app.

    "status": {
        "status_code": "ERROR"
    },
    "attributes": {
        "http.method": "GET",
        ...
        "http.status_code": 500
    },
    "events": []

In case of another WSGI, e.g. Flask, errors are bubbled up in status with the traceback as a span event looking like this

    "status": {
        "status_code": "ERROR",
        "description": "ValueError: bad value"
    },
    "attributes": {
        "http.method": "GET",
        ...
        "http.status_code": 500
    },
    "events": [
        {
            "name": "exception",
            "timestamp": "2024-06-19T10:44:00.468880Z",
            "attributes": {
                "exception.type": "ValueError",
                "exception.message": "bad value",
                "exception.stacktrace": "Traceback ...",
                "exception.escaped": "False"
            }
        }
    ]

Such traces are much more valuable in troubleshooting.

Describe the solution you'd like

Implement recording of exceptions as status attributes and span events in Pyramid instrumentation, similar to how it is done for other WSGI apps.

Describe alternatives you've considered

No response

Additional Context

No response

Would you like to implement a fix?

Yes

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions