Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(develop): clarify trace context's client_sample_rate #13174

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mjq
Copy link
Member

@mjq mjq commented Mar 31, 2025

DESCRIBE YOUR PR

When reading the Trace Context docs, I assumed that client_sample_rate (like all the other fields) was expected to be set by the client. Instead, this field is generated in Relay. If a client sets this field, it will be ignored and overwritten. Added a note to the docs for this field to clarify how it is meant to be used.

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+

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 added an urgent due date to it.
    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

When reading the Trace Context docs, I assumed that `client_sample_rate` (like
all the other fields) was expected to be set by the client. Instead, this field
is generated in Relay. If a client sets this field, it will be ignored and
overwritten. Added a note to the docs for this field to clarify how it is meant
to be used.
@mjq mjq requested review from a team March 31, 2025 16:09
Copy link

vercel bot commented Mar 31, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
develop-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 1, 2025 8:58pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
changelog ⬜️ Ignored (Inspect) Visit Preview Apr 1, 2025 8:58pm
sentry-docs ⬜️ Ignored (Inspect) Visit Preview Apr 1, 2025 8:58pm

@@ -682,7 +682,7 @@ Additional information that allows Sentry to connect multiple transactions, span

`client_sample_rate`

: _Optional_. The client-side sample rate.
: _Optional_. The client-side sample rate. This field will be populated by relay. Incoming values are ignored.
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is fully correct, we have a code path which re-creates the DSC when the parent project is not in the same org or missing.

Maybe @jan-auer can also chime in?

Copy link
Member Author

@mjq mjq Mar 31, 2025

Choose a reason for hiding this comment

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

Yes, this was the subject of @jan-auer's recent changes. The DSC generation happens here. But the sample rate is taken from the incoming DSC, never from the trace context's client_sample_rate - that field is never read, only set (taken from the DSC, after being recreated if necessary).

Hopefully Jan can confirm.

Co-authored-by: Alex Krawiec <[email protected]>
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