-
Notifications
You must be signed in to change notification settings - Fork 514
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
Use new scopes default integrations. #2856
Use new scopes default integrations. #2856
Conversation
Co-authored-by: Daniel Szoke <szokeasaurusrex@users.noreply.github.com>
…com:getsentry/sentry-python into antonpirker/new-scopes-default-integrations
with hub.configure_scope() as scope: | ||
scope.clear_breadcrumbs() | ||
scope.add_event_processor(_make_request_processor(weak_request)) | ||
scope.generate_propagation_context() |
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.
I know you mentioned this, but why is this necessary again?
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.
Not sure if it is, but it's a direct translation to what the configure_scope
was doing in the background:
sentry-python/sentry_sdk/hub.py
Lines 597 to 622 in 6a2280e
def configure_scope( # noqa | |
self, | |
callback=None, # type: Optional[Callable[[Scope], None]] | |
continue_trace=True, # type: bool | |
): | |
# type: (...) -> Optional[ContextManager[Scope]] | |
""" | |
.. deprecated:: 2.0.0 | |
This function is deprecated and will be removed in a future release. | |
Reconfigures the scope. | |
:param callback: If provided, call the callback with the current scope. | |
:returns: If no callback is provided, returns a context manager that returns the scope. | |
""" | |
scope = Scope.get_isolation_scope() | |
if continue_trace: | |
scope.generate_propagation_context() | |
if callback is not None: | |
# TODO: used to return None when client is None. Check if this changes behavior. | |
callback(scope) | |
return None |
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.
Got it. Thanks!
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.
Everything but aiohttp
(which is what I did) looks good to me.
I'd advocate for adding breaking changes to the migration guide in this PR directly so that we don't forget.
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.
I have one question (see comment) but otherwise looks good
Related to #2817