You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 14, 2024. It is now read-only.
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 before sampleRate
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?
The SDKs behave differently when it comes to session updates for dropped events.
There are four ways of dropping an event:
sampleRateignoredExceptionForTypes, also calledignore_errorseventProcessor(scoped and global)beforeSendpython
In python all of them drop the event before updating the session. The order of execution in python is:
ignore_errorssampleRateeventProcessor(scoped) - called error_processorseventProcessor(global) - called event_processorsbeforeSendJava
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 sentsampleRate- 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 updateLink 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:
sampleRateeventProcessor- 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.beforeSendNote:
ignoredExceptionForTypesdoesn'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
sampleRateas the session should reflect reality not dropped data - If it wasn't an error, don't count it.**
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?ignoredExceptionForTypesbeforesampleRateQuestions:
sampleRatedrops and nothing else. Should we change the implementations to match this?