Skip to content

ref(ds): Specify how the DSC is interpreted in Relay#17899

Open
Dav1dde wants to merge 3 commits into
masterfrom
dav1d/ds-dsc-rewrite
Open

ref(ds): Specify how the DSC is interpreted in Relay#17899
Dav1dde wants to merge 3 commits into
masterfrom
dav1d/ds-dsc-rewrite

Conversation

@Dav1dde
Copy link
Copy Markdown
Member

@Dav1dde Dav1dde commented May 27, 2026

DESCRIBE YOUR PR

Adds more information how the DSC is interpreted and applied in Relay.

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

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
Copy link
Copy Markdown

vercel Bot commented May 27, 2026

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

Project Deployment Actions Updated (UTC)
develop-docs Ready Ready Preview, Comment May 27, 2026 8:27am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
sentry-docs Ignored Ignored Preview May 27, 2026 8:27am

Request Review

@Dav1dde Dav1dde requested review from a team and shellmayr May 27, 2026 07:32
@Dav1dde Dav1dde force-pushed the dav1d/ds-dsc-rewrite branch from 5545fae to 84baf8c Compare May 27, 2026 07:34
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.

I'm not sure what "Requires DSC" meas in this case, can we be more specific what the condition here is?

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.

Payload requires DSC, is that better? 🤔

Comment on lines +132 to +135
The existence of a dynamic sampling context does not necessarily mean it is valid, Relay differentiates between three cases:
1. No dynamic sampling context
2. A dynamic sampling context originating from the same organization
3. A dynamic sampling context originating in a project of a different organization or from an unknown project.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
The existence of a dynamic sampling context does not necessarily mean it is valid, Relay differentiates between three cases:
1. No dynamic sampling context
2. A dynamic sampling context originating from the same organization
3. A dynamic sampling context originating in a project of a different organization or from an unknown project.
The existence of a dynamic sampling context does not necessarily mean it is valid. Relay differentiates between three cases:
1. No dynamic sampling context
2. A dynamic sampling context originating in a project of the same organization
3. A dynamic sampling context originating in a project of a different organization or an unknown project.

2. A dynamic sampling context originating from the same organization
3. A dynamic sampling context originating in a project of a different organization or from an unknown project.

If an envelope received by Relay does not contain a dynamic sampling context it is always sampled. Certain payloads do always require a dynamic sampling context to be present and will be rejected without a dynamic sampling context.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I realize that the second sentence is meant to describe an exception to the first, but they sound contradictory. Perhaps it would help to be explicit about which payloads require a DSC.

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.

I decided against having an exhaustive list here, these lists go out of date quickly and I'd prefer this document to describe methodology not implementation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In that case, I would suggest something like

Suggested change
If an envelope received by Relay does not contain a dynamic sampling context it is always sampled. Certain payloads do always require a dynamic sampling context to be present and will be rejected without a dynamic sampling context.
Certain payloads do always require a dynamic sampling context to be present and will be rejected without a dynamic sampling context. All other payloads will always be sampled if they do not contain a dynamic sampling context.

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.

Reworded things a bit.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Much better, thank you!

Comment on lines +133 to +141
1. No dynamic sampling context.
2. A dynamic sampling context originating in a project of the same organization.
3. A dynamic sampling context originating in a project of a different organization or an unknown project.

If an envelope received by Relay does not contain a dynamic sampling context it is always sampled, unless the payload requires a DSC to always be present.

A dynamic sampling context which originates from either the same project or a project within the same organization is considered valid and Relay will apply the sampling rules from the root project as described in the previous section.

DSCs originating in different organizations or unknown projects are discarded and Relay will re-compute a DSC based on the data of the payload and scoped to the current project. The computed dynamic sampling context is then used to apply the dynamic sampling rules.
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.

I think this would be easier to parse if we inline the descriptions into the list, and make the headers bold.

Suggested change
1. No dynamic sampling context.
2. A dynamic sampling context originating in a project of the same organization.
3. A dynamic sampling context originating in a project of a different organization or an unknown project.
If an envelope received by Relay does not contain a dynamic sampling context it is always sampled, unless the payload requires a DSC to always be present.
A dynamic sampling context which originates from either the same project or a project within the same organization is considered valid and Relay will apply the sampling rules from the root project as described in the previous section.
DSCs originating in different organizations or unknown projects are discarded and Relay will re-compute a DSC based on the data of the payload and scoped to the current project. The computed dynamic sampling context is then used to apply the dynamic sampling rules.
1. **No dynamic sampling context**: If an envelope received by Relay does not contain a dynamic sampling context it is always sampled, unless the payload requires a DSC to always be present.
2. **A dynamic sampling context originating in a project of the same organization**: A dynamic sampling context which originates from either the same project or a project within the same organization is considered valid and Relay will apply the sampling rules from the root project as described in the previous section.
3. **A dynamic sampling context originating in a project of a different organization or an unknown project**: DSCs originating in different organizations or unknown projects are discarded and Relay will re-compute a DSC based on the data of the payload and scoped to the current project. The computed dynamic sampling context is then used to apply the dynamic sampling rules.

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.

3 participants