Skip to content

Preserve Hub binding for streaming responses in sentry-tower/axum #1208

Description

@szokeasaurusrex

When using the sentry-tower/axum integration with streaming responses, the middleware binds the hub only for the request handler. Once the handler returns a streaming body, the middleware unwinds and axum drains the stream outside that hub. This causes missing context and any newly set context to be attached to the wrong hub during stream evaluation.

Track the tracing/transaction behavior separately in #1053.

A possible direction is to bind the hub to the response stream, similar to getsentry/objectstore#526.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions