Skip to content

feat(huey): Migrate Huey integration to spans-first tracing#6399

Open
ericapisani wants to merge 6 commits into
py-2426-fix-group-and-chord-handlingfrom
py-2331-huey-span-first
Open

feat(huey): Migrate Huey integration to spans-first tracing#6399
ericapisani wants to merge 6 commits into
py-2426-fix-group-and-chord-handlingfrom
py-2331-huey-span-first

Conversation

@ericapisani
Copy link
Copy Markdown
Member

@ericapisani ericapisani commented May 25, 2026

Builds on a bug fix (PY-2426/ #6392 )

Migrates the Huey integration to support the new spans-first tracing lifecycle (trace_lifecycle: "stream"), while keeping full backwards compatibility with the existing transaction-based path.

Fixes PY-2331 and #6029

@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 25, 2026

PY-2331

@ericapisani ericapisani changed the base branch from master to py-2426-fix-group-and-chord-handling May 25, 2026 15:19
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 25, 2026

Codecov Results 📊

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

📊 Comparison with Base Branch

Metric Change
Total Tests
Passed Tests
Failed Tests
Skipped Tests

✨ No test changes detected

All tests are passing successfully.

❌ Patch coverage is 20.00%. Project has 15088 uncovered lines.
❌ Project coverage is 33.15%. Comparing base (base) to head (head).

Files with missing lines (2)
File Patch % Lines
utils.py 51.64% ⚠️ 456 Missing and 82 partials
huey.py 14.41% ⚠️ 95 Missing
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
- Coverage    34.93%    33.15%    -1.78%
==========================================
  Files          190       190         —
  Lines        22671     22569      -102
  Branches      7730      7692       -38
==========================================
+ Hits          7918      7481      -437
- Misses       14753     15088      +335
- Partials       832       745       -87

Generated by Codecov Action

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ericapisani
Copy link
Copy Markdown
Member Author

bugbot run
@sentry review

Comment thread sentry_sdk/integrations/huey.py
Comment thread tests/integrations/huey/test_huey.py
@ericapisani ericapisani marked this pull request as ready for review May 25, 2026 16:17
@ericapisani ericapisani requested a review from a team as a code owner May 25, 2026 16:17
Comment thread sentry_sdk/integrations/huey.py
…to test order of spans generated since that's stable
Copy link
Copy Markdown

@cursor cursor Bot left a comment

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 97fb86c. Configure here.

if not is_span_streaming_enabled:
scope.transaction.set_status(SPANSTATUS.INTERNAL_ERROR)
elif type(scope._span) is StreamedSpan:
scope._span._segment.status = SpanStatus.ERROR
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Subclass control-flow misclassified

Medium Severity

This commit adds Huey control-flow handling in should_be_treated_as_error via isinstance, but _capture_exception still gates on exc_info[0] in HUEY_CONTROL_FLOW_EXCEPTIONS. Subclasses of RetryTask, CancelExecution, or TaskLockedException skip that branch, so span streaming can mark segments error and emit Sentry error events for normal Huey retries or cancellations.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 97fb86c. Configure here.

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.

1 participant