Skip to content

feat(arq): Support span streaming - #6506

Merged
alexander-alderman-webb merged 10 commits into
masterfrom
webb/arq/span-first
Jun 5, 2026
Merged

feat(arq): Support span streaming#6506
alexander-alderman-webb merged 10 commits into
masterfrom
webb/arq/span-first

Conversation

@alexander-alderman-webb

@alexander-alderman-webbalexander-alderman-webb commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Depends on #6507

Description

In the streaming path, use

  • messaging.message.id instead of the arq_task_id extra

Tags/Extras not set as attributes

  • arq_task_id
  • arq_task_retry
  • arq-job.task
  • arq-job.args
  • arq-job.kwargs
  • arq-job.retry

Adapting Tests

sed commands used for converting transaction context managers:

  • sed -i '' 's/with start_transaction():/with sentry_sdk.traces.start_span(name="custom parent"):/g'
  • sed -i '' 's/with start_transaction() as transaction:/with sentry_sdk.traces.start_span(name="custom parent") as span:/g'

sed commands used for converting event capture:

  • sed -i '' 's/capture_events,/capture_items,/g'
  • sed -i '' 's/events = capture_events()/items = capture_items("event", "transaction", "span")/g'
  • sed -i '' 's/event["spans"]/spans/g'
  • sed -i '' 's/init_fixture_method(/init_fixture_method(span_streaming, /g'
  • sed -i '' 's/(event,) = events/spans = [item.payload for item in items if item.type == "span"]/g'

sed commands used for converting op:

  • sed -i '' 's/"op"/["attributes"]["sentry.op"]/g' tests/integrations/rq/test_rq.py

sed commands used for converting origin:

  • sed -i '' 's/["origin"]/["attributes"]["sentry.origin"]/g'

Issues

Closes#6000

Reminders

@alexander-alderman-webb
alexander-alderman-webb marked this pull request as ready for review June 5, 2026 07:11
@alexander-alderman-webb
alexander-alderman-webb requested a review from a team as a code ownerJune 5, 2026 07:11
Comment threadsentry_sdk/integrations/arq.py Outdated
@github-actions

github-actionsBot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

88722 passed | ⏭️ 6025 skipped | Total: 94747 | Pass Rate: 93.64% | Execution Time: 300m 46s

📊 Comparison with Base Branch

MetricChange
Total Tests📈 +182
Passed Tests📈 +182
Failed Tests
Skipped Tests

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 2474 uncovered lines.
✅ Project coverage is 89.39%. Comparing base (base) to head (head).

Files with missing lines (1)
FilePatch %Lines
sentry_sdk/integrations/arq.py100.00%⚠️ 1 partials
Coverage diff
@@ Coverage Diff @@## main #PR +/-##
==========================================
+ Coverage 89.37% 89.39% +0.02%
==========================================
Files 192 192 —
Lines 23304 23320 +16
Branches 8012 8020 +8
==========================================
+ Hits 20827 20846 +19- Misses 2477 2474 -3- Partials 1313 1308 -5

Generated by Codecov Action

Comment threadsentry_sdk/integrations/arq.py Outdated
Comment threadsentry_sdk/integrations/arq.py Outdated
Comment threadsentry_sdk/integrations/arq.py Outdated
Comment threadsentry_sdk/integrations/arq.py

@cursorcursorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d14aa20. Configure here.

Comment threadsentry_sdk/integrations/arq.py
@alexander-alderman-webb
alexander-alderman-webb changed the base branch from master to webb/arq/control-flow-exceptionsJune 5, 2026 08:08
Base automatically changed from webb/arq/control-flow-exceptions to masterJune 5, 2026 13:04
Comment threadsentry_sdk/integrations/arq.py
@alexander-alderman-webb
alexander-alderman-webb merged commit 9e54e14 into masterJun 5, 2026
144 checks passed
@alexander-alderman-webb
alexander-alderman-webb deleted the webb/arq/span-first branch June 5, 2026 13:19
mgaligniana pushed a commit to mgaligniana/sentry-python that referenced this pull request Aug 9, 2026
Replace the `arq_task_id` tag with the `messaging.message.id` attribute in the streaming lifecycle mode. Do not set the `arq_task_retry` tag or entries in the `rq-job` extra as attributes in the streaming mode.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate arq to span first

2 participants

@alexander-alderman-webb@sentrivana