8000 Specify behaviour of session updates on dropped events · Issue #537 · getsentry/develop · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Aug 14, 2024. It is now read-only.
This repository was archived by the owner on Aug 14, 2024. It is now read-only.
Specify behaviour of session updates on dropped events #537
@adinauer

Description

@adinauer

The SDKs behave differently when it comes to session updates for dropped events.

There are four ways of dropping an event:

  • sampleRate
  • ignoredExceptionForTypes, also called ignore_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_processors
  • eventProcessor (global) - called event_processors
  • beforeSend
  • --- session update --- never reached for dropped events

Java

The behaviour and order in Java differs from the python implementation:

  • eventProcessor (scoped) - early return on drop
  • eventProcessor (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 update
  • ignoredExceptionForTypes - semi early return, session has already been updated but is not being sent immediately
  • beforeSend - 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:

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 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?
  • Do we want to align filter order across SDKs?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0