fix(tracing): Skip child span creation in streaming path when no current span (task queues)#6814
fix(tracing): Skip child span creation in streaming path when no current span (task queues)#6814sentrivana wants to merge 1 commit into
Conversation
…ent span (task queues) When span streaming is enabled and there is no current span, task queue integrations should not create new root segments for child-span operations. This adds a guard check using `sentry_sdk.traces.get_current_span()` before creating spans in the streaming path. Affected integrations: celery, huey, arq, ray. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Results 📊✅ 89992 passed | ❌ 40 failed | ⏭️ 6282 skipped | Total: 96314 | Pass Rate: 93.44% | Execution Time: 306m 20s 📊 Comparison with Base Branch
➕ New Tests (40)View new tests
❌ Failed Tests
|
| File | Patch % | Lines |
|---|---|---|
| sentry_sdk/integrations/ray.py | 0.00% | |
| sentry_sdk/integrations/celery/init.py | 50.00% |
Coverage diff
@@ Coverage Diff @@
## main #PR +/-##
==========================================
- Coverage 89.78% 89.24% -0.54%
==========================================
Files 193 193 —
Lines 23898 23914 +16
Branches 8258 8268 +10
==========================================
+ Hits 21454 21340 -114
- Misses 2444 2574 +130
- Partials 1353 1352 -1Generated by Codecov Action
Summary
sentry_sdk.traces.get_current_span() is Noneguard before creating spans in the streaming pathTest plan
🤖 Generated with Claude Code