Skip to content

feat(tracing): Send sentry.segment.name.source instead of sentry.span.source attribute#6835

Merged
Lms24 merged 6 commits into
masterfrom
lms/feat-span-first-send-segment.name.source
Jul 17, 2026
Merged

feat(tracing): Send sentry.segment.name.source instead of sentry.span.source attribute#6835
Lms24 merged 6 commits into
masterfrom
lms/feat-span-first-send-segment.name.source

Conversation

@Lms24

@Lms24 Lms24 commented Jul 17, 2026

Copy link
Copy Markdown
Member

Following the deprecation of sentry.span.source, this PR renames the attribute from sentry.span.source to sentry.segment.name.source.

Background: We currently decided not do do segment name clustering for streamed spans but should we ever choose to do it, sentry.segment.name.source will be the attribute carrying the name source for it. Either way, sentry.span.source has no effect anymore.

Reviewers, please let me know about your preferences:

  • Technically, the renaming might break user callbacks relying on the old attribute. Since this only affects streamed spans I think it's fine but if you have other policies for span first, we can also double-write.
  • I decided to rename SegmentSource to SegmentNameSource for consistency. Is this considered breaking? If so, happy to revert as it's purely a cosmetic change IMHO.

@Lms24 Lms24 self-assigned this Jul 17, 2026
@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

91854 passed | ⏭️ 6302 skipped | Total: 98156 | Pass Rate: 93.58% | Execution Time: 315m 53s

📊 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 100.00%. Project has 2478 uncovered lines.
✅ Project coverage is 89.68%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    89.68%    89.68%        —%
==========================================
  Files          193       193         —
  Lines        24004     24004         —
  Branches      8340      8340         —
==========================================
+ Hits         21526     21526         —
- Misses        2478      2478         —
- Partials      1387      1387         —

Generated by Codecov Action

@Lms24
Lms24 marked this pull request as ready for review July 17, 2026 08:06
@Lms24
Lms24 requested a review from a team as a code owner July 17, 2026 08:06
Comment thread sentry_sdk/integrations/celery/__init__.py Outdated
attributes={
"sentry.origin": CeleryIntegration.origin,
"sentry.span.source": TransactionSource.TASK.value,
"sentry.segment.name.source": SegmentNameSource.TASK.value,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Seer pointed out that the "wrong" enum was used here (no big deal as the values were identical). So I changed it over to SegmentNameSource

Comment thread sentry_sdk/integrations/rq.py
@ericapisani

Copy link
Copy Markdown
Member

Still need to take a look at the changes themselves but to initially answer your questions in the pull request summary:

Technically, the renaming might break user callbacks relying on the old attribute. Since this only affects streamed spans I think it's fine but if you have other policies for span first, we can also double-write.

As of right now I don't believe there are callbacks relying on this attribute so I think this should be a safe to do right now.

I decided to rename SegmentSource to SegmentNameSource for consistency. Is this considered breaking? If so, happy to revert as it's purely a cosmetic change IMHO.

Since the underlying value hasn't changed, this isn't considered this breaking. 🚀

@ericapisani ericapisani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🚀

Comment thread tests/integrations/aiohttp/test_aiohttp.py Outdated
Comment thread sentry_sdk/integrations/rq.py
Comment thread sentry_sdk/traces.py Outdated
Lms24 and others added 2 commits July 17, 2026 15:08
Co-authored-by: Erica Pisani <hey@ericapisani.dev>
@Lms24
Lms24 merged commit 9996734 into master Jul 17, 2026
146 checks passed
@Lms24
Lms24 deleted the lms/feat-span-first-send-segment.name.source branch July 17, 2026 13:42
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.

2 participants