Skip to content

Commit 25fa49b

Browse files
authored
feat(js): Improve tracesSampler docs for JS (#10759)
1 parent 3215b18 commit 25fa49b

File tree

3 files changed

+3
-23
lines changed

3 files changed

+3
-23
lines changed

docs/platforms/javascript/common/configuration/sampling.mdx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,12 @@ By default, none of these options are set, meaning no transactions will be sent
5858

5959
## Sampling Context Data
6060

61-
### Default Sampling Context Data
62-
63-
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.
64-
65-
<PlatformContent includePath="performance/default-sampling-context" />
66-
67-
### Custom Sampling Context Data
68-
69-
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.
61+
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.
7062

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

65+
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`.
66+
7367
</PlatformSection>
7468

7569
## Inheritance

platform-includes/performance/default-sampling-context-platform/javascript.mdx

Lines changed: 0 additions & 13 deletions
This file was deleted.

platform-includes/performance/default-sampling-context/javascript.mdx

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)