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

Scope refactoring (merge Hubs and Scopes) #2610

Merged
merged 333 commits into from
Feb 26, 2024
Merged

Conversation

antonpirker
Copy link
Member

@antonpirker antonpirker commented Dec 19, 2023

This refactors the SDK to move away from the Hub and have all the functionality in the Scope. Introducing different types of scopes. This aligns the SDK with how Opentelementry (OTel) handles data bringing us closer to be 100% OTel compatible.

This change was discussed in this RFC:
getsentry/rfcs#122

There is also a small FAQ:
https://gist.github.com/mitsuhiko/1bc78d04ea7d08e5b50d27e42676db80

And a Miro board showing how the new scopes manage data:
https://miro.com/app/board/uXjVNtPiOfI=/?share_link_id=216270218892

This RP contains

  • Introduction of global, isolation, and current scope
  • Deprecation of the Hub
  • All existing Hub based API still works and is still used by most of our integrations. Under the hood the new Scopes are used.
  • (this PR now includes all the changes made in the first PR introducing the new API)

Breaking changes

  • The Pyramid integration will not capture errors that might happen in authenticated_userid() in a custom AuthenticationPolicy class.
  • The parameter propagate_hub in ThreadingIntegration() was deprecated and renamed to propagate_scope.

Timeline

  • We will release an alpha version of this as Sentry SDK 2.0 mid February 2024.
  • If everything works fine we will release the final version of Sentry SDK 2.0 end of February 2024.
  • All integrations will be updated to use the new API in minor releases after 2.0 has been released.

@antonpirker antonpirker changed the base branch from master to new-scopes-add-api December 19, 2023 13:20
@antonpirker antonpirker changed the title (2) Call new scopes related API (2) Call new scopes related API (but not calling it) Jan 22, 2024
@antonpirker antonpirker changed the title (2) Call new scopes related API (but not calling it) (2) Integrate new scopes related API Jan 22, 2024
@antonpirker antonpirker merged commit 656ac9d into sentry-sdk-2.0 Feb 26, 2024
106 of 110 checks passed
@antonpirker antonpirker deleted the new-scopes-call-api branch February 26, 2024 14:19
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

5 participants