Skip to content

ref(opentelemetry): Remove enhanceDscWithOpenTelemetryRootSpanName - #22797

Merged
mydea merged 12 commits into
fn/name-inferralfrom
fn/remove-dsc-enhancer
Jul 29, 2026
Merged

ref(opentelemetry): Remove enhanceDscWithOpenTelemetryRootSpanName#22797
mydea merged 12 commits into
fn/name-inferralfrom
fn/remove-dsc-enhancer

Conversation

@mydea

@mydea mydea commented Jul 29, 2026

Copy link
Copy Markdown
Member

Stacked on top of #22712.

With the span name/source inference reworked in #22712, core's getDynamicSamplingContext now derives the DSC transaction name from the root span and applies the url source guard itself. That makes the OpenTelemetry-specific createDsc handler enhanceDscWithOpenTelemetryRootSpanName redundant — it was only there to re-derive the name/source via parseSpanDescription before core did so natively.

This removes the util along with its call sites in @sentry/node, @sentry/vercel-edge, and the opentelemetry test helper, and drops it from the package's public exports.

Since the enhancer is a public export of @sentry/opentelemetry, its removal is technically breaking for anyone importing it directly — which is why this targets the breaking-change branch #22712.

Comment thread packages/node/src/sdk/index.ts
@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 29.82 kB - -
@sentry/browser - with treeshaking flags 28.02 kB - -
@sentry/browser (incl. Tracing) 47.1 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 47.1 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.81 kB - -
@sentry/browser (incl. Tracing, Replay) 86.4 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.84 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 91.12 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 103.77 kB - -
@sentry/browser (incl. Feedback) 47.13 kB - -
@sentry/browser (incl. sendFeedback) 34.66 kB - -
@sentry/browser (incl. FeedbackAsync) 39.76 kB - -
@sentry/browser (incl. Metrics) 30.89 kB - -
@sentry/browser (incl. Logs) 31.12 kB - -
@sentry/browser (incl. Metrics & Logs) 31.8 kB - -
@sentry/react 31.6 kB - -
@sentry/react (incl. Tracing) 49.33 kB - -
@sentry/vue 34.74 kB - -
@sentry/vue (incl. Tracing) 49.05 kB - -
@sentry/svelte 29.85 kB - -
CDN Bundle 31.87 kB - -
CDN Bundle (incl. Tracing) 47.45 kB - -
CDN Bundle (incl. Logs, Metrics) 33.42 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 48.83 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 72.78 kB - -
CDN Bundle (incl. Tracing, Replay) 85.09 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.39 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 90.86 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.17 kB - -
CDN Bundle - uncompressed 95.04 kB - -
CDN Bundle (incl. Tracing) - uncompressed 142.25 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 99.75 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 146.23 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 224.51 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 261.51 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 265.48 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 275.22 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 279.17 kB - -
@sentry/nextjs (client) 51.92 kB - -
@sentry/sveltekit (client) 47.51 kB - -
@sentry/core/server 79.58 kB -0.01% -4 B 🔽
@sentry/core/browser 51.6 kB - -
@sentry/node 121.31 kB -0.32% -378 B 🔽
@sentry/node/import (ESM hook with diagnostics-channel injection) 166 B - -
@sentry/node - without tracing 84.79 kB -0.53% -450 B 🔽
@sentry/aws-serverless 93.04 kB -0.46% -424 B 🔽
@sentry/cloudflare (withSentry) - minified 197.55 kB - -
@sentry/cloudflare (withSentry) 485.69 kB - -

View base workflow run

Comment thread packages/opentelemetry/src/propagator.ts Outdated
Comment thread packages/opentelemetry/src/propagator.ts
@mydea
mydea marked this pull request as ready for review July 29, 2026 07:53
@mydea
mydea requested review from a team as code owners July 29, 2026 07:53
@mydea
mydea requested review from andreiborza and isaacs and removed request for a team July 29, 2026 07:53
@mydea
mydea force-pushed the fn/remove-dsc-enhancer branch from c293a03 to 05ad85e Compare July 29, 2026 08:32
Comment thread packages/opentelemetry/src/trace.ts
@mydea
mydea requested a review from a team as a code owner July 29, 2026 13:34
@mydea
mydea requested review from nicohrubec and s1gr1d and removed request for a team July 29, 2026 13:34
mydea and others added 11 commits July 29, 2026 15:34
more fixes

moar fixes

fixxx
Core's `getDynamicSamplingContext` now derives the DSC transaction name and
handles the `url` source guard directly from the root span, making the
OpenTelemetry-specific DSC enhancer redundant. Remove the util and its call
sites in node, vercel-edge, and the otel test helper.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
With enhanceDscWithOpenTelemetryRootSpanName removed, the DSC for a continued
remote trace is built by core's getDynamicSamplingContextFromSpan, which derives
`sampled` from the root span's binary trace flags. That cannot tell a deferred
sampling decision (which lives in the OTel trace state) apart from a definitive
unsampled one — both read as `traceFlags: NONE` — so a deferred remote trace
wrongly propagated `sentry-sampled=false`.

Reconcile the span-derived DSC with the OTel sampling decision resolved by
`getSamplingDecision` in the propagator's remote-span branch: drop `sampled`
when deferred, and drop the transaction name when definitively unsampled
(matching the OTel SDK, whose unsampled spans are nameless).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
reconcileDscSampled must only touch a DSC that core freshly derives from the
span's binary trace flags. When a continued remote trace froze its own DSC on
the trace state, getDynamicSamplingContextFromSpan returns it verbatim and the
propagation spec treats it as immutable — reconciling would strip its
`transaction` (on an unsampled trace) or rewrite `sampled`. This mirrors the
old createDsc handler, which only ran on core's fresh-generate path and never
saw a frozen DSC.

Guard on the presence of an incoming `sentry.dsc` trace-state entry and skip
reconciliation in that case. Adds a regression test for a directly-injected
unsampled remote span with a frozen incoming DSC.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mydea
mydea force-pushed the fn/remove-dsc-enhancer branch from b5eb299 to baf73c5 Compare July 29, 2026 13:35

@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 2 potential issues.

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 baf73c5. Configure here.

@@ -1,7 +1,5 @@
export { getScopesFromContext } from './utils/contextData';

export { enhanceDscWithOpenTelemetryRootSpanName } from './utils/enhanceDscWithOpenTelemetryRootSpanName';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Public API removed without migration docs

Medium Severity

enhanceDscWithOpenTelemetryRootSpanName was a public export of @sentry/opentelemetry and is removed here with no deprecation path and no entry under the @sentry/opentelemetry section in MIGRATION.md, where other public removals for that package are already listed. This violates the PR review rule on removal of publicly exported APIs / public API changes without proper deprecation notices. I flagged this because it was mentioned in the rules file.

Additional Locations (2)
Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit baf73c5. Configure here.

Comment thread dev-packages/e2e-tests/test-applications/nitro-3/tests/isolation.test.ts Outdated
@mydea
mydea merged commit 2efeed3 into develop Jul 29, 2026
208 checks passed
@mydea
mydea deleted the fn/remove-dsc-enhancer branch July 29, 2026 14:13
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