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

feat(js): Improve tracesSampler docs for JS #10759

Merged
merged 2 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions docs/platforms/javascript/common/configuration/sampling.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,12 @@ By default, none of these options are set, meaning no transactions will be sent

## Sampling Context Data

### Default Sampling Context Data

The information contained in the <PlatformIdentifier name="sampling-context" /> object passed to the <PlatformIdentifier name="traces-sampler" /> when a transaction is created varies by platform and integration.

<PlatformContent includePath="performance/default-sampling-context" />

### Custom Sampling Context Data

When using custom instrumentation to create a span, the `tracesSampler` function will automatically receive the span `name` and the initial span `attributes` to use in its sampling decision.
When a span is started, the `tracesSampler` function will automatically receive the span `name` and the initial span `attributes` to use in its sampling decision. Additionally, it will also receive a `parentSampled` boolean indicating whether the parent span was sampled. This data can be used to make a more informed decision about whether to sample the span.

<PlatformContent includePath="performance/custom-sampling-context" />

Please note that the `name` passed to `tracesSampler` may not be the exact same name that is eventually sent to Sentry. The name may be updated during the lifetime of the span, but the `name` passed to `tracesSampler` will always be the initial name. For example, the `name` for `http.server` spans will usually not be parametrized yet when passed to `tracesSampler`, so instead of `GET /users/:id` you may see a name of `GET /users/123`.

</PlatformSection>

## Inheritance
Expand Down

This file was deleted.

This file was deleted.

Loading