Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Document session update for dropped events #551

Merged
merged 3 commits into from
Apr 26, 2022
Merged
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
18 changes: 18 additions & 0 deletions src/docs/sdk/sessions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -505,3 +505,21 @@ Sessions are never tracked nor sent individually, instead they are aggregated an
As an implementation hint to the point above, when a "Client" is closed or flushed the associated "Session Flusher" shall also be flushed and submit the current aggregates the the transport, before the transport is flushed/closed.
Make sure this works reasonably for Serverless — there we shall not use "request mode" and SessionFlusher because we cannot have any work that happens outside of the request-response flow.
Provide an easy way to integrate with existing Node frameworks (Express, Next.js, Koa).

### Session update filtering

Events may be dropped by our filtering mechanisms (sample rate, beforeSend, event processors or ignored exception types). Only events dropped due to sampling should update the session despite being dropped as we assume the event was dropped to save quota but would have been something the developer cares about. Events dropped due to other reasons should not update the session as we assume they are more likely to be dropped because the developer chooses to ignore them.

#### Filter order

The python SDK shall serve as a reference here. The order for filtering error events is:
1. Check for ignored exception types (a.k.a `ignore_errors`)
3. Apply scoped `event_processor` (a.k.a `error_processor`)
4. Apply global `event_processor`
2. Apply `before_send`
5. Update the session if an event made it this far
6. Apply sampling rate

#### Sending the session update

If the event has been dropped and the session updated, the session update should be sent to the server without the event in case the session changed from healthy to errored or from any state to crashed for user attended sessions.