ref: Add streaming trace decorator (7)#5594
ref: Add streaming trace decorator (7)#5594sentrivana wants to merge 8 commits intoivana/span-first-6-add-continue-and-new-tracefrom
Conversation
157d123 to
54f81af
Compare
9a80374 to
941863e
Compare
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. Bug Fixes 🐛
Documentation 📚
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
Codecov Results 📊✅ 13 passed | Total: 13 | Pass Rate: 100% | Execution Time: 7.01s All tests are passing successfully. ❌ Patch coverage is 17.50%. Project has 13855 uncovered lines. Files with missing lines (2)
Generated by Codecov Action |
…na/span-first-7-add-trace-decorator
…na/span-first-7-add-trace-decorator
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.
| def __exit__( | ||
| self, ty: "Optional[Any]", value: "Optional[Any]", tb: "Optional[Any]" | ||
| ) -> None: | ||
| pass |
There was a problem hiding this comment.
Context manager __enter__ doesn't register span as active
Medium Severity
StreamedSpan.__enter__ just returns self without setting the span as the active span on the scope. The existing Span.__enter__ in tracing.py does scope.span = self so that nested spans can discover their parent. Without this, create_streaming_span_decorator's with start_streaming_span(...) never makes the span visible to the scope, so nested @trace-decorated functions each create independent root spans instead of forming a parent-child tree. The corresponding __exit__ also doesn't restore the previous span or set error status on exceptions, unlike the analogous Span.__exit__.


Description
Add the streaming equivalent of the
@tracedecorator.Issues
Reminders
tox -e linters.feat:,fix:,ref:,meta:)