-
-
Notifications
You must be signed in to change notification settings - Fork 434
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
Hubs / Scopes Merge 17 - Add global scope #3319
Conversation
…pes-merge-2-add-scopes
|
@@ -47,6 +47,8 @@ private Sentry() {} | |||
|
|||
/** The Main Hub or NoOp if Sentry is disabled. */ | |||
private static volatile @NotNull IScopes mainScopes = NoOpScopes.getInstance(); | |||
// TODO cannot pass options here | |||
private static volatile @NotNull IScope globalScope = new Scope(new SentryOptions()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be possible for users to set data on global scope even before Sentry.init
. Not quite sure where we should go with implementation. Likely we'll need a Scope
constructor that doesn't require options and set options later on. Not quite sure how that should affect limits (e.g. for breadcrumbs) etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Problem resolved in #3362
Performance metrics 🚀
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, assuming all todos will be followed up later.
TODOs have been resolved in #3362 |
#skip-changelog
📜 Description
Add global scope.
💡 Motivation and Context
Certain things should be globally accessable (default client, throwable to span map, ...).
This will also allow users to set certain things globally without worrying about Sentry.init or risking lost updates.
💚 How did you test it?
📝 Checklist
sendDefaultPII
is enabled.🔮 Next steps