Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/includes/configuration/auto-session-tracking/javascript.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
We create a session for every page load. For single-page applications, we will create a new session for every navigation change (History API).
We create a session for every page load. For single-page applications, we will create a new session for every navigation change (History API).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest we link to the content for the History API.


We mark the session as crashed if an _unhandled error_ or _unhandled promise rejection_ bubbled up to the global handler.
We mark the session as:
- crashed if an _unhandled error_ or _unhandled promise rejection_ bubbled up to the global handler.
- an error if the SDK captures an event that contains an exception (this includes manually captured errors).

We mark the session as an error if the SDK captures an event that contains an exception (this includes manually captured errors).

By default, the JavaScript SDKs are sending sessions, to disable this toggle the flag `autoSessionTracking` to `false`:
By default, the JavaScript SDKs are sending sessions. To disable sending sessions, set the `autoSessionTracking` flag to `false`:

```javascript
Sentry.init({
Expand Down
22 changes: 22 additions & 0 deletions src/includes/configuration/auto-session-tracking/node.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Release health on the server side is tracked in two different modes:
- Single sessions that represent a node process; for example, a CLI application. In single sessions mode, the SDK creates a session for every node process. A session is started on `init` of the SDK, and ends when the process is exited.
- Session aggregates represent requests. In session aggregates mode, sessions will be recorded differently and will represent the lifetime of requests. For the SDK to be able to capture request mode sessions, you must enable the `requestHandler` of the [express middleware](/platforms/node/guides/express).

```javascript
// The request handler must be the first middleware on the app
app.use(Sentry.Handlers.requestHandler());
```

The SDK automatically determines which mode Release Health will operate in. By default, the SDK runs in single sessions mode. However, if the `requestHandler` express middleware is enabled, Release Health is automatically toggled to session aggregates mode. If the `requestHandler` express middleware is not enabled, session aggregates mode will not be enabled and sessions will represent the health of the web server application process if, for example, a web server application is being run.

We mark the session as crashed if an _unhandled error_ reached our `errorHandler` middleware.

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`:

```javascript
Sentry.init({
autoSessionTracking: false // default: true
});
```