sentry-java
sentry-java copied to clipboard
Hubs/Scopes Merge 31 - Fix `EventProcessor` ordering on `Scopes`
#skip-changelog
:scroll: Description
:bulb: Motivation and Context
Due to now having multiple scopes (current, isolation and global) event processor ordering could no longer rely on insertion order into a single list.
:green_heart: How did you test it?
:pencil: Checklist
- [ ] I reviewed the submitted code.
- [ ] I added tests to verify the changes.
- [ ] No new PII added or SDK only sends newly added PII if
sendDefaultPII
is enabled. - [ ] I updated the docs if needed.
- [ ] Review from the native team if needed.
- [ ] No breaking change or entry added to the changelog.
- [ ] No breaking change for hybrid SDKs or communicated to hybrid SDKs.
:crystal_ball: Next steps
Messages | |
---|---|
:book: | Do not forget to update Sentry-docs with your feature once the pull request gets approved. |
Generated by :no_entry_sign: dangerJS against 5c7d4eff3737d90d34279684c4224aa88be6eb8d
Performance metrics :rocket:
Plain | With Sentry | Diff | |
---|---|---|---|
Startup time | 414.27 ms | 483.82 ms | 69.55 ms |
Size | 1.70 MiB | 2.28 MiB | 596.32 KiB |
Previous results on branch: feat/hsm-31-event-processor-ordering
Startup times
Revision | Plain | With Sentry | Diff |
---|---|---|---|
8896e07bc32df3b0ea492e644d816c49c7505c5f | 381.22 ms | 455.54 ms | 74.32 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
8896e07bc32df3b0ea492e644d816c49c7505c5f | 1.70 MiB | 2.28 MiB | 596.32 KiB |
To be honest: I'm still not sure if we need this at all.
We need some sort of mechanism to sort event processors present on the scopes (global, isolation, current). A user typically shouldn't need to worry about order. It should just work by using insertion order. This PR is providing it under the hood but also allows users to customize when their custom event processor is run.
processor stages (e.g. ~EARLY, AFTER_MAIN_PROCESSING, LATE, ...)
This could be achieved by providing numeric values for those stages, e.g. as constants.