We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b9e765f commit b4be7aaCopy full SHA for b4be7aa
sentry_sdk/scope.py
@@ -489,7 +489,14 @@ def set_client(
489
If `None` the client of the scope will be replaced by a :py:class:`sentry_sdk.NonRecordingClient`.
490
491
"""
492
- self.client = client if client is not None else NonRecordingClient()
+ if client is not None:
493
+ self.client = client
494
+ # We need a client to set the initial global attributes on the global
495
+ # scope since they mostly come from client options, so populate them
496
+ # as soon as a client is set
497
+ sentry_sdk.get_global_scope()._set_global_attributes()
498
+ else:
499
+ self.client = NonRecordingClient()
500
501
def fork(self) -> "Scope":
502
0 commit comments