Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update session also for non sampled events and change filter order #1394

Merged
merged 6 commits into from Apr 20, 2022

Conversation

adinauer
Copy link
Member

We have already merged #1390 where we moved ignore_errors before sampling.

Background for the order change:
We want to update the session for dropped events in case the event is dropped by sampling. Events dropped by other mechanisms should not update the session. See getsentry/develop#551

Now we would like to discuss if we can simply move sampling after before_send and event_processor then update the session right before sampling.

What are implications of changing this?

  • How does this affect session count and session crash rate?
  • Will this have a negative effect on performance as before_send and event_processor will now be executed for every event instead of only being executed for sampled events? Developers may have fine tuned their sample rate for a good performance tradeoff and now we change how this behaves. Also developers can supply their own implementations for both before_send and event_processor on some SDKs so we have no way of predicting performance I'm afraid.
  • We are uncertain why a developer chose to drop an event in before_send and event_processor:
    • Was it because they want to ignore the event - then it shouldn't update the session
    • Or was it to save quota - then it should update the session

Please feel free to optimize the code this is just to start the discussion.

We have already merged #1390 where we moved `ignore_errors` before sampling.

Background for the order change:
We want to update the session for dropped events in case the event is dropped by sampling. Events dropped by other mechanisms should not update the session. See getsentry/develop#551

Now we would like to discuss if we can simply move sampling after `before_send` and `event_processor` and update the session right before sampling.
What are implications of changing this?
* How does this affect session count and session crash rate?
* Will this have a negative effect on performance as `before_send` and `event_processor` will now be executed for every event instead of only being executed for sampled events? Developers may have fine tuned their sample rate for a good performance tradeoff and now we change. Also developers can supply their own implementations for both `before_send` and `event_processor` on some SDKs so we have no way of predicting performance I'm afraid.
* We are uncertain why a developer chose to drop an event in `before_send` and `event_processor`:
** Was it because they want to ignore the event - then it shouldn't update the session
** Or was it to save quota - then it should update the session

Please feel free to optimize the code this is just to start the discussion.
@sl0thentr0py sl0thentr0py marked this pull request as draft April 14, 2022 12:06
@sl0thentr0py
Copy link
Member

made it a draft so we don't merge before we're sure of the changes

@sl0thentr0py
Copy link
Member

@adinauer made a fix because the new sample function should only affect errors and not transactions

@sl0thentr0py sl0thentr0py marked this pull request as ready for review April 20, 2022 14:57
@sl0thentr0py sl0thentr0py merged commit 4cce4b5 into master Apr 20, 2022
@sl0thentr0py sl0thentr0py deleted the adinauer-patch-1 branch April 20, 2022 14:58
adinauer added a commit to getsentry/develop that referenced this pull request Apr 20, 2022
Python now serves as reference implementations. We've recently changed the order there, see getsentry/sentry-python#1394 and getsentry/sentry-python#1390
adinauer added a commit to getsentry/develop that referenced this pull request Apr 26, 2022
* Document session update for dropped events

See #537 and getsentry/sentry-java#1916

Do we also want to document order of the filtering mechanisms? If so do we go with the python implementation order as a template?

* Add filter order

Python now serves as reference implementations. We've recently changed the order there, see getsentry/sentry-python#1394 and getsentry/sentry-python#1390

* Session update should be sent...

... despite the event being dropped in application mode for certain cases.
brustolin pushed a commit to getsentry/develop that referenced this pull request Apr 26, 2022
* Document session update for dropped events

See #537 and getsentry/sentry-java#1916

Do we also want to document order of the filtering mechanisms? If so do we go with the python implementation order as a template?

* Add filter order

Python now serves as reference implementations. We've recently changed the order there, see getsentry/sentry-python#1394 and getsentry/sentry-python#1390

* Session update should be sent...

... despite the event being dropped in application mode for certain cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants