Skip to content

Commit 3728064

Browse files
ahmedetefyHazATPeloWriteriker-barriocanal
authored
feat(node): Add docs for server side release health (#3541)
* feat(node): Add docs for server side release health * Apply suggestions from code review Co-authored-by: Fiona <[email protected]> Co-authored-by: iker barriocanal <[email protected]> * feat: Use node section Co-authored-by: Daniel Griesser <[email protected]> Co-authored-by: Fiona <[email protected]> Co-authored-by: iker barriocanal <[email protected]>
1 parent ae09434 commit 3728064

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

src/includes/configuration/auto-session-tracking/javascript.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
We create a session for every page load. For single-page applications, we will create a new session for every navigation change (History API).
1+
We create a session for every page load. For single-page applications, we will create a new session for every navigation change (History API).
22

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

5-
We mark the session as an error if the SDK captures an event that contains an exception (this includes manually captured errors).
6-
7-
By default, the JavaScript SDKs are sending sessions, to disable this toggle the flag `autoSessionTracking` to `false`:
7+
By default, the JavaScript SDKs are sending sessions. To disable sending sessions, set the `autoSessionTracking` flag to `false`:
88

99
```javascript
1010
Sentry.init({
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Release health on the server side is tracked in two different modes:
2+
- 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.
3+
- 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).
4+
5+
```javascript
6+
// The request handler must be the first middleware on the app
7+
app.use(Sentry.Handlers.requestHandler());
8+
```
9+
10+
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.
11+
12+
We mark the session as crashed if an _unhandled error_ reached our `errorHandler` middleware.
13+
14+
We mark the session as an error if the SDK captures an event that contains an exception (this includes manually captured exceptions).
15+
16+
By default, the JavaScript SDKs are sending sessions, to disable this toggle the flag `autoSessionTracking` to `false`:
17+
18+
```javascript
19+
Sentry.init({
20+
autoSessionTracking: false // default: true
21+
});
22+
```

0 commit comments

Comments
 (0)