Skip to content

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
@vercel
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

`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.

Copy link
Member

Choose a reason for hiding this comment

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

Co-authored-by: Alex Krawiec <alex.krawiec@sentry.io>
@mjq mjq merged commit f8ca46e into master Apr 10, 2025
10 checks passed
@mjq mjq deleted the mjq-client-sample-rate-note branch April 10, 2025 09:19
@cleptric
Copy link
Member

@mjq reverted your change in #13325 and removed all none SDK context from the docs, as this is just a source of confusion about what the SDKs emit.

@mjq
Copy link
Member Author

mjq commented Apr 10, 2025

@cleptric Makes sense. Thanks! 👍

bitsandfoxes pushed a commit that referenced this pull request Apr 24, 2025
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.

Co-authored-by: Alex Krawiec <alex.krawiec@sentry.io>
@github-actions github-actions bot locked and limited conversation to collaborators Apr 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants