Skip to content

Commit ceb88b0

Browse files
committed
Rephrase the tracesSampleRate situation
1 parent a2ca66c commit ceb88b0

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

docs/migration/v8-to-v9.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,6 @@ Older Typescript versions _may_ continue to be compatible, but no guarantees app
5555

5656
### `@sentry/core` / All SDKs
5757

58-
- Passing `undefined` as a `tracesSampleRate` option value will now be treated the same as if the option was not defined at all.
59-
In previous versions, it was checked whether `tracesSampleRate` or `traceSampler` are _defined_ at all, in `Sentry.init()` to determine whether tracing should be enabled.
60-
Passing `undefined` to `tracesSampleRate` previously would enable tracing without the performance monitoring aspect (=tracing being enabled, though no spans would be started).
61-
If you want to preserve having tracing enabled without creating spans, set `tracesSampleRate: 0`:
62-
63-
```diff
64-
Sentry.init({
65-
- tracesSampleRate: undefined,
66-
+ tracesSampleRate: 0,
67-
});
68-
```
69-
7058
- Dropping spans in the `beforeSendSpan` hook is no longer possible.
7159
This means you can no longer return `null` from the `beforeSendSpan` hook.
7260
This hook is intended to be used to add additional data to spans or remove unwanted attributes (for example for PII stripping).
@@ -93,6 +81,12 @@ Older Typescript versions _may_ continue to be compatible, but no guarantees app
9381
});
9482
```
9583

84+
- Passing `undefined` as a `tracesSampleRate` option value will now be treated the same as if the attribute was not defined at all.
85+
In previous versions, it was checked whether the `tracesSampleRate` property existed in the SDK options to determine whether to propagate trace data for distributed tracing.
86+
Consequentially, this sometimes caused the SDK to propagate negative sampling decisions when `tracesSampleRate: undefined` was passed.
87+
This is no longer the case and sampling decisions will be deferred to downstream SDKs for distributed tracing.
88+
This is more of a bugfix rather than a breaking change, however, depending on the setup of your SDKs, an increase in sampled traces may be observed.
89+
9690
- If you use the optional `captureConsoleIntegration` and set `attachStackTrace: true` in your `Sentry.init` call, console messages will no longer be marked as unhandled (i.e. `handled: false`) but as handled (i.e. `handled: true`).
9791
If you want to keep sending them as unhandled, configure the `handled` option when adding the integration:
9892

0 commit comments

Comments
 (0)