feat(huey): Migrate Huey integration to spans-first tracing#6399
feat(huey): Migrate Huey integration to spans-first tracing#6399ericapisani wants to merge 6 commits into
Conversation
…s set correctly on segments in _capture_exception method
Codecov Results 📊✅ 282 passed | Total: 282 | Pass Rate: 100% | Execution Time: 43.88s 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ❌ Patch coverage is 20.00%. Project has 15088 uncovered lines. Files with missing lines (2)
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 -87Generated by Codecov Action |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
bugbot run |
…to test order of spans generated since that's stable
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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 |
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit 97fb86c. Configure here.


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