You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR updates & streamlines our handling of certain `undefined`
options:
First, we do not want to differentiate anymore between options being
unset and set to `undefined` - the resulting behavior should be the
same. This especially applies to the tracing options `tracesSampleRate`,
`tracesSampler` and `enableTracing` - if any of those is set to
`undefined`, `hasEnabledTracing()` will be true and certain things will
happen.
In v9, we want to change this so that `undefined` will also result in
`hasEnabledTracing() === false`. We'll warn if we encounter such a
scenario.
Another related thing this PR does is streamline how we handle falsy
values for `environment`, `release` and `dist` on an event. Today, we go
out of our way to check if the properties are set and only update them
accordingly. However, fasly values do not make sense for these fields
anyhow, so we can streamline this a bit and simply check for truthiness
to determine if we want to use event, option, or default values.
Closes#14261
Copy file name to clipboardExpand all lines: docs/migration/draft-v9-migration-guide.md
+16
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,22 @@
2
2
3
3
# Deprecations
4
4
5
+
## General
6
+
7
+
-**Passing `undefined` to `tracesSampleRate` / `tracesSampler` / `enableTracing` will be handled differently in v9**
8
+
9
+
In v8, a setup like the following:
10
+
11
+
```ts
12
+
Sentry.init({
13
+
tracesSampleRate: undefined,
14
+
});
15
+
```
16
+
17
+
Will result in tracing being _enabled_, although no spans will be generated.
18
+
In v9, we will streamline this behavior so that passing `undefined` will result in tracing being disabled, the same as not passing the option at all.
19
+
If you are relying on `undefined` being passed in and having tracing enabled because of this, you should update your config to set e.g. `tracesSampleRate: 0` instead, which will also enable tracing in v9.
20
+
5
21
## `@sentry/utils`
6
22
7
23
-**The `@sentry/utils` package has been deprecated. Import everything from `@sentry/core` instead.**
`[Sentry] Deprecation warning: \`${undefinedOption}\` is set to undefined, which leads to tracing being enabled. In v9, a value of \`undefined\` will result in tracing being disabled.`,
`[Sentry] Deprecation warning: \`${key}\` is set to undefined, which leads to tracing being enabled. In v9, a value of \`undefined\` will result in tracing being disabled.`,
`[Sentry] Deprecation warning: \`${key}\` is set to undefined, which leads to tracing being enabled. In v9, a value of \`undefined\` will result in tracing being disabled.`,
'[Sentry] Deprecation warning: Returning null from `beforeSendSpan` will be disallowed from SDK version 9.0.0 onwards. The callback will only support mutating spans. To drop certain spans, configure the respective integrations directly.',
1209
+
);
1210
+
consoleWarnSpy.mockRestore();
1153
1211
});
1154
1212
1155
1213
test('calls `beforeSend` and logs info about invalid return value',()=>{
'[Sentry] Deprecation warning: Returning null from `beforeSendSpan` will be disallowed from SDK version 9.0.0 onwards. The callback will only support mutating spans. To drop certain spans, configure the respective integrations directly.',
0 commit comments