Skip to content

feat(develop): Adjust DSC spec to be compatible with span streaming - #20074

Open
Lms24 wants to merge 2 commits into
masterfrom
lms/feat-dsc-spec-no-baggage-edge-case
Open

Lms24 wants to merge 2 commits into
masterfrom
lms/feat-dsc-spec-no-baggage-edge-case

Conversation

@Lms24

@Lms24 Lms24 commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

DESCRIBE YOUR PR

Adjusts an edge case in the DSC spec and the unified propagation mechanism which was incompatible with span streaming.

Scenario: SDK receives an incoming trace with a sentry-trace header but no DSC via the baggage header (e.g. because the upstream SDK is not compatible with DSC)
Previously: SDKs should freeze an empty DSC to the server span. This resulted in SDKs adding no trace envelope header to their envelopes, and neither propagating the DSC via baggage to downstream services.
Changed: SDKs should materialize a DSC from their own data (i.e. from the segment span as well as information on their client), freeze it to their segment span. This results in a trace envelope header on spans and the DSC being propagated via baggage to downstream SDKs.

SDKs are going to be required to implement the new version (1.4) of the spec when implementing span streaming.

Why this change?

Span v2 envelopes require a trace envelope header to be set by SDKs. For transactions, Relay would infer a DSC from an incoming trace-less transaction envelope. Relay can no longer do this reliably for streamed v2 spans since there's no guarantee that a segment span is in the envelope. Therefore SDKs need to take over this part.

In practise, SDKs have sadly diverged quite a bit from the previously specified behavior for this edge case, with some of them constructing and sending the DSC already for a baggage-less incoming traces. Some send invalid DSC (missing required values) and some actually stick to the 1.3 spec version. With SDKs being required to implement 1.4 when working on span streaming, we can hopefully align them again.

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.
Select exactly one option. For deadlines, replace YYYY-MM-DD with the due date. You can update this information later by editing the PR description.

  • Urgent deadline (GA date, etc.): YYYY-MM-DD
  • Other deadline: YYYY-MM-DD
  • No deadline: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've supplied a deadline.

Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

@vercel

vercel Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
develop-docs Ready Ready Preview Oct 19, 2026 9:36am UTC
1 Skipped Deployment
Project Deployment Actions Updated
sentry-docs Ignored Ignored Preview Oct 19, 2026 9:36am UTC

Request Review

@github-actions github-actions Bot added sdk-develop-docs PRs touching develop-docs/sdk Priority: Needs Triage The PR description is missing valid priority information labels Oct 19, 2026
@cursor

cursor Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Rollouts skipped this pull request: Documentation-only changes in application repos (modified develop-docs MDX files that are not getsentry/sentry-docs or getsentry/sentry-changelog).

Mention @change-monitor in a comment to monitor it anyway.

@github-actions github-actions Bot removed the Priority: Needs Triage The PR description is missing valid priority information label Oct 19, 2026
@Lms24
Lms24 requested a review from cleptric October 19, 2026 09:29
@github-actions github-actions Bot added the Priority: Normal Docs review has no urgent deadline label Oct 19, 2026
@Lms24
Lms24 requested review from Dav1dde and shellmayr October 19, 2026 09:29
envelope.headers.trace = current_segment_span.dynamic_sampling_context
```

<Expandable title="Previous behavior (spec versions 1.0.0 to 1.3.0)">

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.

since the old version is still "valid" for SDKs without span streaming, the 1.3 algorithm stays as an expandable section

Comment thread develop-docs/sdk/telemetry/spans/index.mdx Outdated
Comment thread develop-docs/sdk/telemetry/spans/index.mdx Outdated
Co-authored-by: Lukas Stracke <lukas.stracke@sentry.io>

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

LGTM though this is a lot of SDK specifics I am not familiar with, when and how the DSC is treated within SDKs. The most important part is that there is always a trace header on the envelope which "describes" all contained standalone spans.


If an SDK receives a `sentry-trace` header but no DSC (no `baggage` header with `sentry-` values), continues the trace, and starts a segment span:

- The SDK **MUST NOT** freeze an empty DSC for the continued trace.

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.

Just commentary: An empty DSC was also never a valid DSC. It requires project key and trace id.

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.

"Empty" translated to no trace header being sent and DSC no DSC values being propagated via baggage. I agree that this isn't clearly worded. Will reword a bit.

This branch was successfully deployed

1 active deployment
Preview – develop-docs — 88d2b213 Deployed Oct 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: Normal Docs review has no urgent deadline sdk-develop-docs PRs touching develop-docs/sdk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants