From 04204607b6f8c4c524f6fa3217d7fc74abd61c53 Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Tue, 5 Dec 2023 12:37:21 +0100 Subject: [PATCH] Fixed deprecated transaction creation --- sentry_sdk/scope.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sentry_sdk/scope.py b/sentry_sdk/scope.py index fb4b7e7da1..d88a98dfad 100644 --- a/sentry_sdk/scope.py +++ b/sentry_sdk/scope.py @@ -719,8 +719,7 @@ def start_span(self, span=None, instrumenter=INSTRUMENTER.SENTRY, **kwargs): For supported `**kwargs` see :py:class:`sentry_sdk.tracing.Span`. """ - hub = kwargs.pop("hub", None) - client = kwargs.pop("client", None) + client = kwargs.get("client", None) configuration_instrumenter = client and client.options["instrumenter"] @@ -739,7 +738,7 @@ def start_span(self, span=None, instrumenter=INSTRUMENTER.SENTRY, **kwargs): if isinstance(span, Transaction): logger.warning(deprecation_msg) - return self.start_transaction(span) + return self.start_transaction(span, **kwargs) if "transaction" in kwargs: logger.warning(deprecation_msg) @@ -753,7 +752,7 @@ def start_span(self, span=None, instrumenter=INSTRUMENTER.SENTRY, **kwargs): logger.warning(deprecation_msg) return span - kwargs.setdefault("hub", hub) + kwargs.pop("client") active_span = self.span if active_span is not None: