This repository was archived by the owner on Aug 14, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 221
This repository was archived by the owner on Aug 14, 2024. It is now read-only.
Copy link
Copy link
Closed
Description
The SDKs behave differently when it comes to session updates for dropped events.
There are four ways of dropping an event:
sampleRate
ignoredExceptionForTypes
, also calledignore_errors
eventProcessor
(scoped and global)beforeSend
python
In python all of them drop the event before updating the session. The order of execution in python is:
ignore_errors
sampleRate
eventProcessor
(scoped) - called error_processorseventProcessor
(global) - called event_processorsbeforeSend
- --- session update --- never reached for dropped events
Java
The behaviour and order in Java differs from the python implementation:
eventProcessor
(scoped) - early return on dropeventProcessor
(global) - event set to null, creates and sends envelope if attachments are available, no session update counted or sent- --- session update --- note: this update may not make it to the server immediately
sampleRate
- event set to null, sends attachments and session updateignoredExceptionForTypes
- semi early return, session has already been updated but is not being sent immediatelybeforeSend
- event set to null, sends attachments and session update
Link to issue in sentry-java: getsentry/sentry-java#1916
JS
The JS SDK does not update the session in any of the cases. The order is:
sampleRate
eventProcessor
- I'm not sure on the order of global vs scoped here: https://github.com/getsentry/sentry-javascript/blob/249302aa8fb30648528928a3629a7ea2349de62d/packages/hub/src/scope.ts#L441 My guess would be: global happens before scoped.beforeSend
- --- session update ---
Note: ignoredExceptionForTypes
doesn't seem to be available in JS.
Other SDKs
Cocoa (thanks @philipphofmann), native (thanks @Swatinem) and Rust (thanks @Swatinem) update the session
Desired behaviour / suggestions
- Current implementation in python as a basis (i.e. don't update session for dropped events)
- @bruno-garcia suggested, we update the session for
sampleRate
as the session should reflect reality not dropped data - If it wasn't an error, don't count it. - @untitaker on whether a dropped event should update the session:
**beforeSend
- We don't really know; usecases are overloaded
**sampleRate
- SDK option: IMO yes
**ignoredExceptionForTypes
- option: IMO no
**eventProcessor
- option: IMO no, but it depends who can set an event processor. is that private API? do we know what it's used for? - @untitaker suggested we check
ignoredExceptionForTypes
beforesampleRate
Questions:
- Seems there is some aggreement on only updating the session for
sampleRate
drops and nothing else. Should we change the implementations to match this? - Do we want to align filter order across SDKs?
Metadata
Metadata
Assignees
Type
Projects
Status
Done