Skip to content

Commit 678770f

Browse files
fix: Clarify error level impact on sessions (#15198)
Clarify in the develop docs that only events with level error or higher must mark sessions as errored.
1 parent de68ba7 commit 678770f

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

develop-docs/sdk/telemetry/sessions/index.mdx

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ not report any more session updates or start a new session.
271271

272272
SDKs are encouraged to distinguish between different ways of ending a session:
273273

274-
- `exited`: this means the session ended cleanly. It's is the same as the
274+
- `exited`: this means the session ended cleanly. It's is the same as the
275275
session staying in `ok` from the point of success reports. However only
276276
sessions ending in `exited` will be considered for session durations.
277277
A session is allowed to go to `exited` even if errors occurred.
@@ -314,6 +314,29 @@ count of greater than zero is considered an errored session. All crashed and
314314
abnormal sessions are also at all times considered errored but subtracted from
315315
the final errored session count.
316316

317+
Only events that stem from `captureException`, `captureError`, or `captureEvent`
318+
must increment the `errors` counter when their level is `error` or higher. As SDKs
319+
set the default level to `error` for these methods, a level lower than `error`
320+
means the users changed it manually. This gives the users the ability to capture
321+
error events not marking sessions as errored. `captureEvent` is included because
322+
users might manually create exception events with it. Events stemming from
323+
`captureMessage` must not affect the session's error count, regardless of their
324+
log level. For all methods, it doesn't matter if the event has a stack trace or not.
325+
The following table summarizes the behavior of the methods:
326+
327+
| method | level | increments `errors` counter |
328+
| --- | --- | --- |
329+
| captureException / captureError | `fatal` | `yes` |
330+
| captureException / captureError | `error` | `yes` |
331+
| captureException / captureError | `warning` | `no` |
332+
| captureEvent | `fatal` | `yes` |
333+
| captureEvent | `error` | `yes` |
334+
| captureEvent | `warning` | `no` |
335+
| captureMessage | `fatal` | `no` |
336+
| captureMessage | `error` | `no` |
337+
| captureMessage | `warning` | `no` |
338+
339+
317340
### Exited
318341

319342
A session can transition to `exited` which is exactly the same state as `ok`

0 commit comments

Comments
 (0)