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

Sampling should recommend ParentBasedSampler with TraceIDRatioBasedSampler #5884

Open
thomaschaaf opened this issue Jan 6, 2025 · 2 comments

Comments

@thomaschaaf
Copy link

What needs to be changed?
The sampling page https://github.com/open-telemetry/opentelemetry.io/blob/main/content/en/docs/languages/js/sampling.md currently does not mention ParentBasedSampler. In my opinion the default should be ParentBasedSampler with TraceIDRatioBasedSampler as that is what most newcomers are looking for.

What is the name + path of the page that needs changed? content/en/docs/languages/js/sampling.md

@thomaschaaf thomaschaaf added the bug Something isn't working label Jan 6, 2025
@tiffany76 tiffany76 added sig:javascript and removed bug Something isn't working labels Jan 6, 2025
@tiffany76
Copy link
Contributor

Thanks for raising this issue, @thomaschaaf.

@open-telemetry/javascript-approvers, PTAL. Thanks!

@cartermp
Copy link
Contributor

cartermp commented Jan 7, 2025

I wrote this originally. At the time, I chose not to focus on the combination of the two, but I think now it's fine to do both.

Unfortunately, there is a downside to both behaviors:

  • With ParentBased included, your own service will be (often surprisingly) impacted by any service upstream of you that happens to head sample differently. At my day job I've run into people getting really confused about why some traces weren't present because an upstream service they don't control dictated sampling.
  • With ParentBased excluded, you can get missing spans unexpectedly.

The best way to have really coherent traces with sampling is to use tail-based sampling. But SDKs don't do that.

At any rate, I think including ParentBased is probably less...weird? Surprising? Less common to have weird behavior?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

3 participants