Skip to content

fix(core): Preserve propagation across ignored spans - #22277

Merged
Lms24 merged 4 commits into
developfrom
lms/fix-node-ative-span-http-client-non-recording
Jul 16, 2026
Merged

fix(core): Preserve propagation across ignored spans#22277
Lms24 merged 4 commits into
developfrom
lms/fix-node-ative-span-http-client-non-recording

Conversation

@Lms24

@Lms24Lms24 commented Jul 15, 2026

Copy link
Copy Markdown
Member

This PR preserves trace propagation for ignored spans in span streaming mode:

  • When segment spans are ignored, incoming DSC (via baggage) is kept as-is, but is mutated to carry a negative sampling decision, in line with the sentry-trace header, which already emitted a negative sampling decision
  • ignored child and HTTP client spans propagate from the nearest emitted parent across fetch, node:http
    • For Orchestrion/tracing-channel-based instrumentation, we only set a child span as the active span if it is not ignored. This was already implemented in the OTel context manager previously but probably didn't get ported correctly to the new approach.

Turns out, the DSC changes are also a requirement for #22246, so I threw it on top of this PR.

ref #22262

@github-actions

github-actionsBot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize% ChangeChange
@sentry/browser27.72 kB+0.18%+49 B 🔺
@sentry/browser - with treeshaking flags26.17 kB+0.19%+48 B 🔺
@sentry/browser (incl. Tracing)46.49 kB+0.11%+47 B 🔺
@sentry/browser (incl. Tracing + Span Streaming)48.28 kB+0.1%+46 B 🔺
@sentry/browser (incl. Tracing, Profiling)51.27 kB+0.09%+46 B 🔺
@sentry/browser (incl. Tracing, Replay)85.74 kB+0.06%+44 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags75.38 kB+0.07%+49 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas)90.45 kB+0.06%+46 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback)103.11 kB+0.05%+45 B 🔺
@sentry/browser (incl. Feedback)44.9 kB+0.11%+46 B 🔺
@sentry/browser (incl. sendFeedback)32.52 kB+0.15%+46 B 🔺
@sentry/browser (incl. FeedbackAsync)37.65 kB+0.13%+47 B 🔺
@sentry/browser (incl. Metrics)28.81 kB+0.16%+46 B 🔺
@sentry/browser (incl. Logs)29.05 kB+0.17%+47 B 🔺
@sentry/browser (incl. Metrics & Logs)29.73 kB+0.17%+49 B 🔺
@sentry/react29.53 kB+0.17%+49 B 🔺
@sentry/react (incl. Tracing)48.75 kB+0.11%+49 B 🔺
@sentry/vue33.15 kB+0.15%+47 B 🔺
@sentry/vue (incl. Tracing)48.46 kB+0.09%+42 B 🔺
@sentry/svelte27.75 kB+0.19%+50 B 🔺
CDN Bundle30.12 kB+0.16%+46 B 🔺
CDN Bundle (incl. Tracing)48.47 kB+0.09%+42 B 🔺
CDN Bundle (incl. Logs, Metrics)31.7 kB+0.17%+51 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics)49.78 kB+0.09%+44 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics)70.94 kB+0.08%+50 B 🔺
CDN Bundle (incl. Tracing, Replay)85.97 kB+0.06%+44 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics)87.28 kB+0.06%+46 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback)91.77 kB+0.06%+54 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics)93.03 kB+0.06%+48 B 🔺
CDN Bundle - uncompressed89.78 kB+0.09%+80 B 🔺
CDN Bundle (incl. Tracing) - uncompressed146.54 kB+0.07%+95 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed94.48 kB+0.09%+80 B 🔺
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed150.51 kB+0.07%+95 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed219.21 kB+0.04%+80 B 🔺
CDN Bundle (incl. Tracing, Replay) - uncompressed265.74 kB+0.04%+95 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed269.7 kB+0.04%+95 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed279.44 kB+0.04%+95 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed283.39 kB+0.04%+95 B 🔺
@sentry/nextjs (client)51.3 kB+0.11%+55 B 🔺
@sentry/sveltekit (client)46.93 kB+0.11%+50 B 🔺
@sentry/core/server78.58 kB+0.06%+42 B 🔺
@sentry/core/browser64.93 kB+0.07%+40 B 🔺
@sentry/node-core63.17 kB-0.29%-179 B 🔽
@sentry/node125.41 kB+0.06%+65 B 🔺
@sentry/node (incl. diagnostics channel injection)140.46 kB+0.05%+59 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection)70.03 kB--
@sentry/node/light51.3 kB+0.09%+42 B 🔺
@sentry/node - without tracing74.67 kB+0.05%+30 B 🔺
@sentry/aws-serverless83.9 kB+0.04%+26 B 🔺
@sentry/cloudflare (withSentry) - minified182 kB+0.06%+91 B 🔺
@sentry/cloudflare (withSentry)450.59 kB+0.08%+341 B 🔺

View base workflow run

@Lms24Lms24 self-assigned this Jul 15, 2026
@Lms24

Copy link
Copy Markdown
MemberAuthor

@BugBot review

@cursorcursorBot 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 71c3abc. Configure here.

@Lms24Lms24 changed the title fix(tracing): Preserve propagation across ignored spansfix(core/node): Preserve propagation across ignored spansJul 15, 2026
@Lms24Lms24 changed the title fix(core/node): Preserve propagation across ignored spansfix(core): Preserve propagation across ignored spansJul 15, 2026
@Lms24
Lms24 marked this pull request as ready for review July 15, 2026 14:34
@Lms24
Lms24 requested review from a team as code ownersJuly 15, 2026 14:34
@Lms24
Lms24 requested review from JPeer264, isaacs and mydea and removed request for a teamJuly 15, 2026 14:34
@Lms24
Lms24force-pushed the lms/fix-node-ative-span-http-client-non-recording branch from 71c3abc to 2312ed3CompareJuly 15, 2026 14:55

@cursorcursorBot 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 2312ed3. Configure here.

Comment threadpackages/core/src/tracing/dynamicSamplingContext.ts
Comment threadpackages/opentelemetry/src/nodeAsyncContextStrategy.ts
Lms24and others added 4 commits July 15, 2026 18:35
Keep continued trace sampling data consistent when ignored segment or child
spans are omitted, and propagate from the nearest emitted parent.
Co-Authored-By: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@Lms24
Lms24force-pushed the lms/fix-node-ative-span-http-client-non-recording branch from fa4ba70 to c13f7d1CompareJuly 15, 2026 16:36
Comment threadpackages/node-core/src/utils/outgoingFetchRequest.ts

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

🚀

@Lms24
Lms24 merged commit e8d7bd4 into developJul 16, 2026
313 checks passed
@Lms24
Lms24 deleted the lms/fix-node-ative-span-http-client-non-recording branch July 16, 2026 08:37
Sign up for freeto 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

@Lms24@JPeer264