Skip to content

feat(dramatiq): Support span streaming#6273

Draft
sl0thentr0py wants to merge 1 commit into
masterfrom
neel/span-first-dramatiq
Draft

feat(dramatiq): Support span streaming#6273
sl0thentr0py wants to merge 1 commit into
masterfrom
neel/span-first-dramatiq

Conversation

@sl0thentr0py
Copy link
Copy Markdown
Member

@sl0thentr0py sl0thentr0py commented May 15, 2026

Description

Add a span-streaming branch in SentryMiddleware.before_process_message
and after_process_message alongside the legacy transaction-based path,
gated on has_span_streaming_enabled. The streaming branch uses
sentry_sdk.traces.continue_trace + start_span and stashes the span
context manager on the message so the after-hook can exit it without
relying on scope.transaction (which doesn't exist in streaming mode).

Parametrize the tracing tests over span_streaming True/False so both
modes are covered.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

Issues

@sl0thentr0py sl0thentr0py requested a review from a team as a code owner May 15, 2026 13:42
@sl0thentr0py sl0thentr0py marked this pull request as draft May 15, 2026 13:43
@sl0thentr0py sl0thentr0py removed the request for review from a team May 15, 2026 13:43
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 15, 2026

Codecov Results 📊

282 passed | Total: 282 | Pass Rate: 100% | Execution Time: 42.85s

All tests are passing successfully.

❌ Patch coverage is 0.00%. Project has 14784 uncovered lines.

Files with missing lines (1)
File Patch % Lines
dramatiq.py 0.00% ⚠️ 119 Missing

Generated by Codecov Action

@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 15, 2026

PY-2318

Add a span-streaming branch in SentryMiddleware.before_process_message
and after_process_message alongside the legacy transaction-based path,
gated on has_span_streaming_enabled. The streaming branch uses
sentry_sdk.traces.continue_trace + start_span and stashes the span
context manager on the message so the after-hook can exit it without
relying on scope.transaction (which doesn't exist in streaming mode).

Parametrize the tracing tests over span_streaming True/False so both
modes are covered.

Refs GH-5386
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@sl0thentr0py sl0thentr0py force-pushed the neel/span-first-dramatiq branch from 31489ea to 326b013 Compare May 15, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate dramatiq to span first

1 participant