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
description: "Track healthy Sessions in the Browser."
4
+
notSupported:
5
+
- javascript.cordova
6
+
- javascript.node
7
+
- javascript.aws-lambda
8
+
- javascript.azure-functions
9
+
- javascript.connect
10
+
- javascript.express
11
+
- javascript.fastify
12
+
- javascript.gcp-functions
13
+
- javascript.hapi
14
+
- javascript.koa
15
+
- javascript.nestjs
16
+
- javascript.deno
17
+
- javascript.cloudflare
18
+
- javascript.bun
19
+
---
20
+
21
+
<Alertlevel="info">
22
+
23
+
This integration only works inside a browser environment.
24
+
25
+
</Alert>
26
+
27
+
_Import name: `Sentry.browserSessionIntegration`_
28
+
29
+
Sentry's [Release Health](/product/releases/health/) feature allows you to track user adoption and your application's crash-free rate.
30
+
When the BrowserSession integration is enabled, it automatically creates a session each time a user loads your page or application. These sessions are used to track your release health. If an error is captured during an active session, the session will be flagged as faulty.
31
+
Read more about <PlatformLinkto="/configuration/releases/#sessions">Sessions</PlatformLink>.
Copy file name to clipboardExpand all lines: docs/platforms/javascript/common/configuration/integrations/http.mdx
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,6 +73,13 @@ The callback function receives two arguments:
73
73
-`urlPath`: The URL path of the incoming request, including the query string if available. For example: `/users?name=John`.
74
74
-`request`: An object of type `IncomingMessage` containing the incoming request. You can use this to filter on properties like the request method or headers.
75
75
76
+
### `trackIncomingRequestsAsSessions`
77
+
78
+
_Type: `boolean`_ (Defaults to `true`)
79
+
80
+
Determines whether the integration should create [Sessions](/product/releases/health/#sessions) for incoming requests to track the health and crash-free rate of your releases in Sentry.
81
+
Read more about [Release Health](/product/releases/health/).
82
+
76
83
### `instrumentation`
77
84
78
85
You can also pass some hooks through to the [underlying OpenTelemetry Instrumentation](https://www.npmjs.com/package/@opentelemetry/instrumentation-http):
Copy file name to clipboardExpand all lines: docs/platforms/javascript/common/configuration/options.mdx
+28-16Lines changed: 28 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,12 +41,14 @@ Turns debug mode on or off. If debug is enabled SDK will attempt to print out us
41
41
42
42
Sets the release. Some SDKs will try to automatically configure a release out of the box but it's a better idea to manually set it to guarantee that the release is in sync with your deploy integrations or source map uploads. Release names are strings, but some formats are detected by Sentry and might be rendered differently. Learn more about how to send release data so Sentry can tell you about regressions between releases and identify the potential source in [the releases documentation](/product/releases/) or the <SandboxLinkscenario="releases">sandbox</SandboxLink>.
This option can be used to supply a "server name." When provided, the name of the server is sent along and persisted in the event. For many integrations, the server name actually corresponds to the device hostname, even in situations where the machine is not actually a server.
107
+
This option can be used to supply a "server name." When provided, the name of the server is sent along and persisted in the event. For many integrations, the server name actually corresponds to the device hostname, even in situations where the machine is not actually a server.
108
+
109
+
Most SDKs will attempt to auto-discover this value.
106
110
107
-
Most SDKs will attempt to auto-discover this value.
108
111
</ConfigKey>
109
112
110
113
</PlatformCategorySection>
@@ -141,6 +144,13 @@ Grouping in Sentry is different for events with stack traces and without. As a r
141
144
142
145
Defaults to `true`. When set to `true`, the SDK will send session events to Sentry. This is supported in all browser SDKs, emitting one session per pageload and page navigation to Sentry. In mobile SDKs, when the app goes to the background for longer than 30 seconds, sessions are ended.
143
146
147
+
<Alerttitle="Deprecation Notice">
148
+
149
+
{/* 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. */}
150
+
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.
Copy file name to clipboardExpand all lines: platform-includes/configuration/auto-session-tracking/javascript.electron.mdx
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,8 @@ Due to the nature of `crashed` and `abnormal` exits, these sessions are finished
10
10
11
11
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.
12
12
13
+
{/* TODO(v9): When electron does a new major, update this since autoSessionTracking got removed */}
14
+
13
15
To disable sending sessions, set the `autoSessionTracking` flag to `false`:
{/* 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. */}
27
+
28
+
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.
{/* 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. */}
25
+
26
+
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.
0 commit comments