- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 461
 
          Hubs/Scopes Merge 1 - Introduce IScopes interface.
          #3297
        
          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
Conversation
          
  | 
    
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.
Commented on three instances where the HubScopesWrapper could be used to make it compile when -Werror is disabled.
Otherwise LGTM 👍
| void reportFullyDisplayed(); | ||
| 
               | 
          ||
| /** | ||
| * @deprecated See {@link IHub#reportFullyDisplayed()}. | 
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.
Replace IHub with IScopes
| import org.jetbrains.annotations.NotNull; | ||
| import org.jetbrains.annotations.Nullable; | ||
| 
               | 
          ||
| public interface IScopes { | 
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.
Is there a specific reason we name it plural IScopes instead of IScope?
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.
IScope is already present (i.e. the scope) and IScopes is a set of multiple scopes (isolation scope and current scope) which (sometimes) fork together or separately. IScopes (and Scopes) is meant to be a drop-in replacement for hub.
| * @deprecated See {@link IHub#reportFullyDisplayed()}. | ||
| */ | ||
| @Deprecated | ||
| default void reportFullDisplayed() { | 
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.
Given that we'll do a major bump I guess it's worth considering removing deprecated methods.
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.
Created #3364 to track and added it to 8.0.0 milestone.
#skip-changelog
📜 Description
Tests on this PR will likely fail, there's more PRs migrating
IHubreferences toIScopesand fixing tests.TODO: this should target a new branch for a new major release.
IScopesIHubextendsIScopesso anyHubcan be passed in asIScopes. All methods onIHubhave been moved toIScopes.IHuband methods tied to it likegetCurrentHub,cloneMainHubandclonehave been deprecated.IHubwe're wrappingIScopesusingHubScopesWrapperScopesas a replacement forHubScopesAdapteras a replacement forHubAdapterSentry.getCurrentScopes()replacesSentry.getCurrentHub()Sentry.cloneMainHub()will be replaced in a follow up PR by something likeSentry.forkRootScopes()or similar.TODOcomments in this PR that have to be cleaned up in follow up PRs.Follow up PRs for changing from
IHubtoIScopes:IHubwithIScopesin core #3298IHubwithIScopesin Android core #3299IHubwithIScopesin Android integrations #3300IHubwithIScopesin apollo integrations #3301IHubwithIScopesin OkHttp integration #3302IHubwithIScopesin GraphQL integration #3303IHubwithIScopesin logging integrations #3304IHubwithIScopesin more integrations #3305IHubwithIScopesin OTel integration #3306IHubwithIScopesin Spring 5 / Spring Boot 2 integrations #3308IHubwithIScopesin Spring 6 / Spring Boot 3 integrations #3309IHubwithIScopesin samples #3310💡 Motivation and Context
This is the first PR of many to merge hubs and scopes which is a prerequisite for Performance powered by OpenTelemetry.
💚 How did you test it?
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps