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

ref(session): align processing sequence in sentry__capture_event() with docs #729

Merged
merged 8 commits into from Jul 1, 2022

Conversation

supervacuus
Copy link
Collaborator

Fixes #707.

The specified items in the filter-order apply to sentry-native accordingly:

  • Not implemented: 1. Check for ignored exception types (a.k.a ignore_errors)
  • Not implemented: 2. Apply scoped event_processor (a.k.a error_processor)
  • Is equivalent to sentry__prepare_event(): 3. Apply global event_processor
  • Happens within sentry__prepare_event(): 4. Apply before_send
  • Happens in sentry__capture_event(): 5. Update the session if an event made it this far
  • Happens at the beginning of sentry__prepare_event(): 6. Apply sampling rate

This means, in the current implementation, the sole conflict with the proposed filter order is in the application of the sampling at the beginning of the event processing and thus before before_send and the session update. The remaining implemented filters are in the order suggested in the docs.

This PR moves the sampling application right before the transport invocation. Since this is - essentially - a breaking change (e.g. before_send is no longer affected by sampling and thus called on every event capture) I think we should reflect this in the API docs too. Please advise on where a good place for this might be (beyond the changelog).

@supervacuus supervacuus force-pushed the ref/session_sampling_capture_transport branch from 89e2201 to 2ed455f Compare June 27, 2022 20:42
@Swatinem
Copy link
Member

As you suggested, we can make this behavior more clear in the fn-level docs, and even link to the docs that specify this behavior. We should also call this change out in the changelog.

@supervacuus
Copy link
Collaborator Author

The failing test is unrelated to my latest commit (which was only documentation), but virtual-environment updated the image, which seemingly includes a clang without ASAN support (which is why all runs fail with AddressSanitizer: detect_leaks is not supported on this platform.)

@Swatinem, do you have any immediate suggestions? Otherwise, I would try to figure out how to fix this.

The new virtual-environment image
https://github.com/actions/virtual-environments/releases/tag/macOS-11%2F20220627.1
defaults clang and clang++ in the PATH to 13.0.0 which currently fails
in the CI because there is no "detect_leaks" support.

Clang/LLVM 13.0.1 is also packaged in that image but only accessible via
'$(brew --prefix llvm@13)/bin/clang'.

It is unclear whether this fixes the issue, but in the previous image
we used 13.0.1 successfully with ASAN.
@Swatinem
Copy link
Member

That is most unfortunate :-(
The CI matrix configuration is different from where the actual env flags are defined, I think you need to change that appropriately. Maybe you need to do some if/else logic to have that rule only apply to macOS.

Plus, someone with permissions has to update the branch protection rules once this is ready to merge @ashwoods

@supervacuus
Copy link
Collaborator Author

@Swatinem, @ashwoods: builds work again, so we only need to change the branch protection rules to merge.

@Swatinem Swatinem merged commit 6531a26 into master Jul 1, 2022
@Swatinem Swatinem deleted the ref/session_sampling_capture_transport branch July 1, 2022 08:24
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.

Align SDK with docs regarding session update for dropped events
2 participants