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

Only Spans Docs #11731

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
Draft

Only Spans Docs #11731

wants to merge 13 commits into from

Conversation

cleptric
Copy link
Member

@cleptric cleptric commented Nov 5, 2024

No description provided.

Copy link

vercel bot commented Nov 5, 2024

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

Name Status Preview Comments Updated (UTC)
changelog ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 8, 2024 3:29pm
develop-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 8, 2024 3:29pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
sentry-docs ⬜️ Ignored (Inspect) Visit Preview Nov 8, 2024 3:29pm

The `parentSampleRate` is a propagated value inside the baggage, using key `sentry-sample_rand`.
The value stems from a truly random number between 0 and 1, generated when a new trace is started. If the SDK does not receive such a number in an incoming trace, a new, truly random number between 0 and 1 is generated.

In the following cases, the SDK must compare sample rates against this `parentSampleRate` instead of `math.random()`:
Copy link
Member

Choose a reason for hiding this comment

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

This should be:

Suggested change
In the following cases, the SDK must compare sample rates against this `parentSampleRate` instead of `math.random()`:
In the following cases, the SDK must compare sample rates against this `sentry-sample_rand` instead of `math.random()`:

Should we rephrase this, that the SDK always compares with the sample_rand value, especially the two places? In reality, the SDK should never create a new random number during sampling, only ever when initializing a trace that doesn't have the random value attached yet.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, I'll re-phrase the entire paragraph, as I'm not happy with the current state.

develop-docs/sdk/telemetry/spans/span-sampling.mdx Outdated Show resolved Hide resolved
```

The `parentSampleRate` is a propagated value inside the baggage, using key `sentry-sample_rand`.
The value stems from a truly random number between 0 and 1, generated when a new trace is started. If the SDK does not receive such a number in an incoming trace, a new, truly random number between 0 and 1 is generated.
Copy link
Member

Choose a reason for hiding this comment

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

nit: Should we clarify that the value must be placed in baggage and propagated from now on?

Copy link
Member Author

@cleptric cleptric Nov 8, 2024

Choose a reason for hiding this comment

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

See above, "The parentSampleRate is a propagated value inside the baggage, using key sentry-sample_rand."


## Parent Sampling Origins

If the SDK can parse an org ID from the configured DSN, this value must be propagated as a baggage entry with the key `sentry-org`. Given a DSN of `https://[email protected]/1`, the org ID is 1, based on `o1`.
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't cover self-hosted, most organizations there will have org ID 1. If we're OK with this restriction, I think we should write this down. If we're not OK with this restriction, we'd need to add an additional identifier from the instance, though I currently don't have a good idea where to get this from.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll add this limitation for self-hosted and refer to using the org option in such cases.

develop-docs/sdk/telemetry/spans/span-sampling.mdx Outdated Show resolved Hide resolved
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