Skip to content

ref(core)!: Migrate to SENTRY_SEGMENT_NAME_SOURCE - #23368

Open
RulaKhaled wants to merge 22 commits into
developfrom
feat/segment-name-source-impl
Open

ref(core)!: Migrate to SENTRY_SEGMENT_NAME_SOURCE#23368
RulaKhaled wants to merge 22 commits into
developfrom
feat/segment-name-source-impl

Conversation

@RulaKhaled

@RulaKhaled RulaKhaled commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Besides removing SEMANTIC_ATTRIBUTE_SENTRY_SOURCE and using SENTRY_SEGMENT_NAME_SOURCE instead, this PR also:

  • Sets name source only on segment spans (per the Sentry segment name source convention) — e.g. updateName, HTTP server spans, and tRPC when it is the segment root
  • Removes envelope-time backfill from sentry.source → sentry.segment.name.source in captureSpan

CI note: This PR alone is expected to fail CI. It will stay blocked until #23367 is merged into it — that split is intentional to keep the core changes easier to review.

Fixes #22259

@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.57 kB -0.01% -1 B 🔽
@sentry/browser - with treeshaking flags 26.92 kB +0.02% +4 B 🔺
@sentry/browser - with treeshaking flags tracing without tracing 26.82 kB -0.02% -5 B 🔽
@sentry/browser (incl. Tracing) 48.54 kB +0.09% +41 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 48.56 kB +0.07% +33 B 🔺
@sentry/browser (incl. Tracing, Profiling) 51.47 kB +0.08% +40 B 🔺
@sentry/browser (incl. Tracing, Replay) 87.94 kB +0.06% +47 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.36 kB +0.02% +10 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 92.64 kB +0.06% +55 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 105.35 kB +0.06% +56 B 🔺
@sentry/browser (incl. Feedback) 45.81 kB -0.01% -3 B 🔽
@sentry/browser (incl. sendFeedback) 33.36 kB - -
@sentry/browser (incl. FeedbackAsync) 38.46 kB -0.03% -8 B 🔽
@sentry/browser (incl. Metrics) 29.51 kB -0.04% -11 B 🔽
@sentry/browser (incl. Logs) 29.8 kB +0.02% +3 B 🔺
@sentry/browser (incl. Metrics & Logs) 30.43 kB -0.07% -19 B 🔽
@sentry/react 30.31 kB -0.08% -24 B 🔽
@sentry/react (incl. Tracing) 50.75 kB +0.09% +41 B 🔺
@sentry/vue 35.69 kB +0.15% +50 B 🔺
@sentry/vue (incl. Tracing) 50.77 kB +0.07% +31 B 🔺
@sentry/svelte 28.59 kB -0.04% -9 B 🔽
CDN Bundle 30.36 kB +0.14% +40 B 🔺
CDN Bundle (incl. Tracing) 49.01 kB -0.03% -13 B 🔽
CDN Bundle (incl. Logs, Metrics) 32.56 kB +0.08% +25 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) 50.9 kB +0.02% +7 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 72.92 kB +0.03% +20 B 🔺
CDN Bundle (incl. Tracing, Replay) 86.45 kB -0.02% -11 B 🔽
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.34 kB +0.02% +9 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 92.24 kB +0.02% +13 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.16 kB -0.01% -8 B 🔽
CDN Bundle - uncompressed 89.97 kB +0.04% +29 B 🔺
CDN Bundle (incl. Tracing) - uncompressed 146.64 kB +0.01% +2 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 96.26 kB +0.04% +29 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 152.33 kB +0.01% +2 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 225.23 kB +0.03% +55 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed 265.95 kB +0.02% +28 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 271.62 kB +0.02% +28 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.64 kB +0.02% +28 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 285.31 kB +0.01% +28 B 🔺
@sentry/nextjs (client) 53.3 kB +0.13% +68 B 🔺
@sentry/sveltekit (client) 48.96 kB +0.09% +44 B 🔺
@sentry/core/server 65.19 kB +0.13% +81 B 🔺
@sentry/core/browser 52.34 kB +0.13% +67 B 🔺
@sentry/node 121.5 kB +0.04% +45 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 85.18 kB - -
@sentry/node - without tracing 87.47 kB +0.05% +41 B 🔺
@sentry/aws-serverless 95.9 kB +0.07% +67 B 🔺
@sentry/cloudflare (withSentry) - minified 197.1 kB +0.11% +207 B 🔺
@sentry/cloudflare (withSentry) 487.48 kB +0.01% +6 B 🔺

View base workflow run

@RulaKhaled
RulaKhaled force-pushed the feat/segment-name-source-impl branch from 16a4997 to f187f70 Compare August 12, 2026 14:08
@RulaKhaled RulaKhaled changed the title ref!: Migrate to SENTRY_SEGMENT_NAME_SOURCE ref(core)!: Migrate to SENTRY_SEGMENT_NAME_SOURCE Aug 12, 2026
@RulaKhaled
RulaKhaled force-pushed the feat/segment-name-source-impl branch 3 times, most recently from 5a7db5d to 9c2caf1 Compare August 13, 2026 09:47
@RulaKhaled

Copy link
Copy Markdown
Collaborator Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 9c2caf1. Configure here.

Replace sentry.source with sentry.segment.name.source and set the
attribute only on segment spans.

Fixes #22259

Co-Authored-By: Cursor Grok 4.6 <cursoragent@cursor.com>
@RulaKhaled
RulaKhaled force-pushed the feat/segment-name-source-impl branch from 9acdf57 to e6c54fe Compare August 24, 2026 11:57
@RulaKhaled
RulaKhaled marked this pull request as ready for review August 24, 2026 12:12
@RulaKhaled
RulaKhaled requested review from a team as code owners August 24, 2026 12:12
@RulaKhaled
RulaKhaled requested review from chargome, isaacs and msonnb and removed request for a team August 24, 2026 12:12
Comment thread packages/browser/src/exports.ts
…ints

Restore a same-package migration path where SEMANTIC_ATTRIBUTE_SENTRY_SOURCE
was previously public: browser, Remix server, and SvelteKit server/worker.

Co-Authored-By: Cursor Grok 4.6 <cursoragent@cursor.com>

@s1gr1d s1gr1d 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.

In general, it's good to go but I would double-check if we'll mention "segment" in user-facing APIs.

Comment thread packages/core/src/utils/spanUtils.ts
Comment thread packages/core/src/tracing/sentrySpan.ts
RulaKhaled and others added 2 commits August 24, 2026 16:54
Keep SENTRY_SEGMENT_NAME_SOURCE on conflicted tracing sites while taking develop's startSpan import path and span-name fallbacks.

Co-Authored-By: Cursor Grok 4.6 <cursoragent@cursor.com>
Rename the helper to INTERNAL_setSegmentNameSourceIfSegment and drop 'segment' from the debug log so it is not a user-facing term.

Co-Authored-By: Cursor Grok 4.6 <cursoragent@cursor.com>
Comment thread packages/angular/src/tracing.ts Outdated
RulaKhaled and others added 8 commits August 24, 2026 18:10
The unguarded span API lint rule requires browser-facing code to use the browser entry point so span streaming is installed.

Co-Authored-By: Cursor Grok 4.6 <cursoragent@cursor.com>
That span is always started under an active pageload or navigation root, so sentry.segment.name.source was stripped immediately.

Co-Authored-By: Cursor Grok 4.6 <cursoragent@cursor.com>
Keep SENTRY_SEGMENT_NAME_SOURCE while adopting the new conventions op names from develop.

Co-Authored-By: Cursor Grok 4.6 <cursoragent@cursor.com>
Align unit and E2E tests with segment-only sentry.segment.name.source.

Fixes #22259

Co-Authored-By: Cursor Grok 4.6 <cursoragent@cursor.com>
… HTTP test

Co-Authored-By: Cursor Grok 4.6 <cursoragent@cursor.com>
…Span tests

Co-Authored-By: Cursor Grok 4.6 <cursoragent@cursor.com>
Comment thread packages/server-utils/src/integrations/redis/redis-cache.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8a1e0de. Configure here.

Comment thread packages/core/src/trpc.ts Outdated
@github-actions

Copy link
Copy Markdown
Contributor

👋 @Lms24, @andreiborza — Please review this PR when you get a chance!

RulaKhaled and others added 9 commits August 25, 2026 13:38
Keep tRPC route source on span start so sampling sees it, stop redis cache from deleting source on segment roots, and drop "segment" from the child-span debug warning.

Co-Authored-By: Cursor Grok 4.6 <cursoragent@cursor.com>
Co-Authored-By: Cursor Grok 4.6 <cursoragent@cursor.com>
Co-Authored-By: Cursor Grok 4.6 <cursoragent@cursor.com>
Comment thread packages/core/src/tracing/dynamicSamplingContext.ts
…source-impl

Bring E2E/unit assertion updates onto impl so CI can pass on a single PR.
@RulaKhaled
RulaKhaled requested review from JPeer264 and s1gr1d August 25, 2026 12: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.

Rename SEMANTIC_ATTRIBUTE_SENTRY_SOURCE to sentry.segment.name.source & drop semanticAttributes re-export

2 participants