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
Copy file name to clipboardExpand all lines: docs/migration/v8-to-v9.md
+41-41Lines changed: 41 additions & 41 deletions
Original file line number
Diff line number
Diff line change
@@ -61,42 +61,42 @@ Older Typescript versions _may_ still work, but we will not test them anymore an
61
61
62
62
- 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`). If you want to keep sending them as unhandled, configure the `handled` option when adding the integration:
- Dropping spans in the `beforeSendSpan` hook is no longer possible.
72
72
- The `beforeSendSpan` hook now receives the root span as well as the child spans.
73
73
- In previous versions, we determined if tracing is enabled (for Tracing Without Performance) by checking if either `tracesSampleRate` or `traceSampler` are _defined_ at all, in `Sentry.init()`. This means that e.g. the following config would lead to tracing without performance (=tracing being enabled, even if no spans would be started):
74
74
75
-
```js
76
-
Sentry.init({
77
-
tracesSampleRate:undefined,
78
-
});
79
-
```
75
+
```js
76
+
Sentry.init({
77
+
tracesSampleRate:undefined,
78
+
});
79
+
```
80
80
81
-
In v9, an `undefined` value will be treated the same as if the value is not defined at all. You'll need to set `tracesSampleRate: 0` if you want to enable tracing without performance.
81
+
In v9, an `undefined` value will be treated the same as if the value is not defined at all. You'll need to set `tracesSampleRate: 0` if you want to enable tracing without performance.
82
82
83
83
- The `getCurrentHub().getIntegration(IntegrationClass)` method will always return `null` in v9. This has already stopped working mostly in v8, because we stopped exposing integration classes. In v9, the fallback behavior has been removed. Note that this does not change the type signature and is thus not technically breaking, but still worth pointing out.
84
84
85
85
- The `startSpan` behavior was slightly changed if you pass a custom `scope` to the span start options: While in v8, the passed scope was set active directly on the passed scope, in v9, the scope is cloned. This behavior change does not apply to `@sentry/node` where the scope was already cloned. This change was made to ensure that the span only remains active within the callback and to align behavior between `@sentry/node` and all other SDKs. As a result of the change, your span hierarchy should be more accurate. However, be aware that modifying the scope (e.g. set tags) within the `startSpan` callback behaves a bit differently now.
getCurrentScope().setTag('tag-a', 'a'); // this tag will only remain within the callback
90
+
// set the tag directly on customScope in addition, if you want to to persist the tag outside of the callback
91
+
customScope.setTag('tag-a', 'a');
92
+
});
93
+
```
94
94
95
95
### `@sentry/node`
96
96
97
97
- When `skipOpenTelemetrySetup: true` is configured, `httpIntegration({ spans: false })` will be configured by default.
98
98
99
-
This means that you no longer have to specify this yourself in this scenario. With this change, no spans are emitted once `skipOpenTelemetrySetup: true` is configured, without any further configuration being needed.
99
+
This means that you no longer have to specify this yourself in this scenario. With this change, no spans are emitted once `skipOpenTelemetrySetup: true` is configured, without any further configuration being needed.
100
100
101
101
- The `requestDataIntegration` will no longer automatically set the user from `request.user`. This is an express-specific, undocumented behavior, and also conflicts with our privacy-by-default strategy. Starting in v9, you'll need to manually call `Sentry.setUser()` e.g. in a middleware to set the user on Sentry events.
102
102
@@ -219,23 +219,23 @@ The following changes are unlikely to affect users of the SDK. They are listed h
219
219
220
220
- The options `tracingOptions`, `trackComponents`, `timeout`, `hooks` have been removed everywhere except in the `tracingOptions` option of `vueIntegration()`.
221
221
222
-
These options should now be set as follows:
222
+
These options should now be set as follows:
223
223
224
-
```js
225
-
import*asSentryfrom'@sentry/vue';
224
+
```js
225
+
import*asSentryfrom'@sentry/vue';
226
226
227
-
Sentry.init({
228
-
integrations: [
229
-
Sentry.vueIntegration({
230
-
tracingOptions: {
231
-
trackComponents:true,
232
-
timeout:1000,
233
-
hooks: ['mount', 'update', 'unmount'],
234
-
},
235
-
}),
236
-
],
237
-
});
238
-
```
227
+
Sentry.init({
228
+
integrations: [
229
+
Sentry.vueIntegration({
230
+
tracingOptions: {
231
+
trackComponents:true,
232
+
timeout:1000,
233
+
hooks: ['mount', 'update', 'unmount'],
234
+
},
235
+
}),
236
+
],
237
+
});
238
+
```
239
239
240
240
- The option `logErrors` in the `vueIntegration` has been removed. The Sentry Vue error handler will propagate the error to a user-defined error handler
241
241
or just re-throw the error (which will log the error without modifying).
@@ -255,13 +255,13 @@ Let us know if this is causing issues in your setup by opening an issue on GitHu
255
255
256
256
- The import of Sentry from the deno registry has changed. Use the `import * as Sentry from 'https://deno.land/x/sentry/build/index.mjs'` import instead.
0 commit comments