feat: Set segment source on scope for NoOpStreamedSpan - #7163
feat: Set segment source on scope for NoOpStreamedSpan#7163alexander-alderman-webb wants to merge 9 commits into
NoOpStreamedSpan#7163Conversation
Codecov Results 📊✅ 104113 passed | ⏭️ 6677 skipped | Total: 110790 | Pass Rate: 93.97% | Execution Time: 362m 16s 📊 Comparison with Base Branch
All tests are passing successfully. ❌ Patch coverage is 73.33%. Project has 2488 uncovered lines. Files with missing lines (2)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
- Coverage 90.14% 90.11% -0.03%
==========================================
Files 193 193 —
Lines 25147 25162 +15
Branches 9136 9150 +14
==========================================
+ Hits 22669 22674 +5
- Misses 2478 2488 +10
- Partials 1431 1433 +2Generated by Codecov Action |
…b/set-segment-source-on-scope
| class NoOpStreamedSpan(StreamedSpan): | ||
| __slots__ = ( | ||
| "_noop_name", | ||
| "_segment_source", |
There was a problem hiding this comment.
Can we directly access the segment attributes to get the source instead of adding a new slot? Right now it's a bit of a hybrid -- I'd either do it exclusively via attributes or exclusively via the new slot, but not both. (Preferring the attributes approach to avoid adding a slot and keeping source handling consistent in StreamedSpan vs NoOpStreamedSpan.)
There was a problem hiding this comment.
I've used _attributes now but only store the sentry.segment.name.source attribute to avoid unnecessary pre-serialization.
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 556c404. Configure here.

Description
Add the
attributesparameter toNoOpStreamedSpan.__init__().Add a
_segment_sourcefield toNoOpStreamedSpan.Set the segment source on the scope when a
NoOpStreamedSpanis set on the scope.Issues
Reminders
uv run ruff.feat:,fix:,ref:,meta:)