From 2ca2f011c57545ca958b6c998be2d23131947afb Mon Sep 17 00:00:00 2001 From: Andrei Borza Date: Mon, 17 Feb 2025 12:19:37 +0100 Subject: [PATCH 1/3] ref(v9): Remove v9 todos --- .../integrations/mainprocesssession.mdx | 7 +++---- .../auto-session-tracking/javascript.electron.mdx | 10 ++++++---- .../auto-session-tracking/javascript.node.mdx | 14 -------------- .../getting-started-use/javascript.nestjs.mdx | 8 -------- 4 files changed, 9 insertions(+), 30 deletions(-) diff --git a/docs/platforms/javascript/guides/electron/configuration/integrations/mainprocesssession.mdx b/docs/platforms/javascript/guides/electron/configuration/integrations/mainprocesssession.mdx index 74fe277d48bf3..2bf9ac3d8ad2a 100644 --- a/docs/platforms/javascript/guides/electron/configuration/integrations/mainprocesssession.mdx +++ b/docs/platforms/javascript/guides/electron/configuration/integrations/mainprocesssession.mdx @@ -12,16 +12,15 @@ use the BrowserWindowSession integration in the renderer processes. -{/* TODO(v9): When electron does a new major, update this since autoSessionTracking got removed */} - -Unless `autoSessionTracking` is set to `false`, this integration will be automatically added. +To disable sending sessions, remove the `MainProcessSession` integration: ```javascript import * as Sentry from "@sentry/electron/main"; Sentry.init({ dsn: "___PUBLIC_DSN___", - autoSessionTracking: false, + integrations: (defaults) => + defaults.filter((i) => i.name !== "MainProcessSession"), }); ``` diff --git a/platform-includes/configuration/auto-session-tracking/javascript.electron.mdx b/platform-includes/configuration/auto-session-tracking/javascript.electron.mdx index 7367794a79fdf..e16b5e201ba38 100644 --- a/platform-includes/configuration/auto-session-tracking/javascript.electron.mdx +++ b/platform-includes/configuration/auto-session-tracking/javascript.electron.mdx @@ -10,12 +10,14 @@ Due to the nature of `crashed` and `abnormal` exits, these sessions are finished To receive data on user adoption, such as users crash free rate percentage, and the number of users that have adopted a specific release, set the user on the [`initialScope`](/platforms/javascript/configuration/options/#initial-scope) when initializing the SDK. -{/* TODO(v9): When electron does a new major, update this since autoSessionTracking got removed */} - -To disable sending sessions, set the `autoSessionTracking` flag to `false`: +To disable sending sessions, remove the `MainProcessSession` integration: ```javascript +import * as Sentry from "@sentry/electron/main"; + Sentry.init({ - autoSessionTracking: false, // default: true + dsn: "___PUBLIC_DSN___", + integrations: (defaults) => + defaults.filter((i) => i.name !== "MainProcessSession"), }); ``` diff --git a/platform-includes/configuration/auto-session-tracking/javascript.node.mdx b/platform-includes/configuration/auto-session-tracking/javascript.node.mdx index c873abdc882f0..281cba0bd66e7 100644 --- a/platform-includes/configuration/auto-session-tracking/javascript.node.mdx +++ b/platform-includes/configuration/auto-session-tracking/javascript.node.mdx @@ -14,17 +14,3 @@ Sentry.init({ autoSessionTracking: false, // default: true }); ``` - -{/* TODO(v9): Remove this notice? */} - - - - - -{/* We don't use platform links here because we always have to link to node and browser here and doing a conditional just for that feels overkill. */} - -Starting with SDK version 8.43.0 and up, the `autoSessionTracking` option has been deprecated. You can use the [BrowserSession integration](/platforms/javascript/configuration/integrations/browsersession/) in browser environments and the [Http integration](/platforms/javascript/guides/node/configuration/integrations/http/) (via the `trackIncomingRequestsAsSessions` option) in Node.js runtime. - - - - diff --git a/platform-includes/getting-started-use/javascript.nestjs.mdx b/platform-includes/getting-started-use/javascript.nestjs.mdx index dc5fe5d560f3d..dff137e0dd33b 100644 --- a/platform-includes/getting-started-use/javascript.nestjs.mdx +++ b/platform-includes/getting-started-use/javascript.nestjs.mdx @@ -52,9 +52,6 @@ export class YourCatchAllExceptionFilter implements ExceptionFilter { By default, only unhandled exceptions that are not caught by an error filter are reported to Sentry. `HttpException`s (including [derivatives](https://docs.nestjs.com/exception-filters#built-in-http-exceptions)) are also not captured by default because they mostly act as control flow vehicles. -{/* TODO(v9): Remove this note */} -_Note that `@SentryExceptionCaptured()` was called `@WithSentry` in SDK versions `8.38.0` and prior._ - If you don't have a global catch-all exception filter, add the `SentryGlobalFilter` to the providers of your main module. This filter will report any unhandled errors that aren't caught by other error filters to Sentry. **Important:** The `SentryGlobalFilter` needs to be registered before any other exception filters. @@ -76,11 +73,6 @@ import { SentryGlobalFilter } from "@sentry/nestjs/setup"; export class AppModule {} ``` -{/* TODO(v9): Remove this note. */} - -**Note:** If you have a NestJS + GraphQL application and you are using the `@sentry/nestjs` SDK version `8.38.0` or earlier, replace the `SentryGlobalFilter` with the `SentryGlobalGenericFilter`. -In SDK versions `8.39.0` and above, the `SentryGlobalGenericFilter` is deprecated because the `SentryGlobalFilter` will handle GraphQL contexts automatically. - If you have error filters for specific types of exceptions (for example `@Catch(HttpException)`, or any other `@Catch(...)` with arguments) and you want to capture errors caught by these filters, capture the errors in the `catch()` handler with `Sentry.captureException()`: ```javascript {9} From 5051baedfe07bdfc0e2d5eedc06a3f0f47cff2d1 Mon Sep 17 00:00:00 2001 From: Andrei Borza Date: Mon, 17 Feb 2025 12:34:44 +0100 Subject: [PATCH 2/3] Undo electron changes in favor of https://github.com/getsentry/sentry-docs/pull/12655 --- .../integrations/mainprocesssession.mdx | 7 ++++--- .../auto-session-tracking/javascript.electron.mdx | 10 ++++------ .../auto-session-tracking/javascript.node.mdx | 14 ++++++++++++++ 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/docs/platforms/javascript/guides/electron/configuration/integrations/mainprocesssession.mdx b/docs/platforms/javascript/guides/electron/configuration/integrations/mainprocesssession.mdx index 2bf9ac3d8ad2a..74fe277d48bf3 100644 --- a/docs/platforms/javascript/guides/electron/configuration/integrations/mainprocesssession.mdx +++ b/docs/platforms/javascript/guides/electron/configuration/integrations/mainprocesssession.mdx @@ -12,15 +12,16 @@ use the BrowserWindowSession integration in the renderer processes. -To disable sending sessions, remove the `MainProcessSession` integration: +{/* TODO(v9): When electron does a new major, update this since autoSessionTracking got removed */} + +Unless `autoSessionTracking` is set to `false`, this integration will be automatically added. ```javascript import * as Sentry from "@sentry/electron/main"; Sentry.init({ dsn: "___PUBLIC_DSN___", - integrations: (defaults) => - defaults.filter((i) => i.name !== "MainProcessSession"), + autoSessionTracking: false, }); ``` diff --git a/platform-includes/configuration/auto-session-tracking/javascript.electron.mdx b/platform-includes/configuration/auto-session-tracking/javascript.electron.mdx index e16b5e201ba38..7367794a79fdf 100644 --- a/platform-includes/configuration/auto-session-tracking/javascript.electron.mdx +++ b/platform-includes/configuration/auto-session-tracking/javascript.electron.mdx @@ -10,14 +10,12 @@ Due to the nature of `crashed` and `abnormal` exits, these sessions are finished To receive data on user adoption, such as users crash free rate percentage, and the number of users that have adopted a specific release, set the user on the [`initialScope`](/platforms/javascript/configuration/options/#initial-scope) when initializing the SDK. -To disable sending sessions, remove the `MainProcessSession` integration: +{/* TODO(v9): When electron does a new major, update this since autoSessionTracking got removed */} -```javascript -import * as Sentry from "@sentry/electron/main"; +To disable sending sessions, set the `autoSessionTracking` flag to `false`: +```javascript Sentry.init({ - dsn: "___PUBLIC_DSN___", - integrations: (defaults) => - defaults.filter((i) => i.name !== "MainProcessSession"), + autoSessionTracking: false, // default: true }); ``` diff --git a/platform-includes/configuration/auto-session-tracking/javascript.node.mdx b/platform-includes/configuration/auto-session-tracking/javascript.node.mdx index 281cba0bd66e7..c873abdc882f0 100644 --- a/platform-includes/configuration/auto-session-tracking/javascript.node.mdx +++ b/platform-includes/configuration/auto-session-tracking/javascript.node.mdx @@ -14,3 +14,17 @@ Sentry.init({ autoSessionTracking: false, // default: true }); ``` + +{/* TODO(v9): Remove this notice? */} + + + + + +{/* We don't use platform links here because we always have to link to node and browser here and doing a conditional just for that feels overkill. */} + +Starting with SDK version 8.43.0 and up, the `autoSessionTracking` option has been deprecated. You can use the [BrowserSession integration](/platforms/javascript/configuration/integrations/browsersession/) in browser environments and the [Http integration](/platforms/javascript/guides/node/configuration/integrations/http/) (via the `trackIncomingRequestsAsSessions` option) in Node.js runtime. + + + + From 16a578ec0214154c36e09f045c19d306fb351c50 Mon Sep 17 00:00:00 2001 From: Andrei Borza Date: Mon, 17 Feb 2025 12:48:19 +0100 Subject: [PATCH 3/3] Explain how to disable sending sessions in the node SDK --- .../auto-session-tracking/javascript.node.mdx | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/platform-includes/configuration/auto-session-tracking/javascript.node.mdx b/platform-includes/configuration/auto-session-tracking/javascript.node.mdx index c873abdc882f0..7ed83295e2e2e 100644 --- a/platform-includes/configuration/auto-session-tracking/javascript.node.mdx +++ b/platform-includes/configuration/auto-session-tracking/javascript.node.mdx @@ -7,24 +7,14 @@ We mark the session as crashed if an _unhandled error_ reached our `errorHandler We mark the session as an error if the SDK captures an event that contains an exception (this includes manually captured exceptions). -By default, the JavaScript SDKs are sending sessions, to disable this toggle the flag `autoSessionTracking` to `false`: +By default, the SDK is sending sessions, to disable this configure the `httpIntegration` with the `trackIncomingRequestsAsSessions` option set to `false`. ```javascript Sentry.init({ - autoSessionTracking: false, // default: true + integrations: [Sentry.httpIntegration({ + trackIncomingRequestsAsSessions: false, // default: true + })] }); ``` -{/* TODO(v9): Remove this notice? */} - - - - - -{/* We don't use platform links here because we always have to link to node and browser here and doing a conditional just for that feels overkill. */} - -Starting with SDK version 8.43.0 and up, the `autoSessionTracking` option has been deprecated. You can use the [BrowserSession integration](/platforms/javascript/configuration/integrations/browsersession/) in browser environments and the [Http integration](/platforms/javascript/guides/node/configuration/integrations/http/) (via the `trackIncomingRequestsAsSessions` option) in Node.js runtime. - - - - +A session is automatically created for every node process by the `processSessionIntegration` which is configured by default.