From a6cec41a2f4889d54339d3249db1acbe0c680e46 Mon Sep 17 00:00:00 2001 From: Neel Shah Date: Mon, 14 Mar 2022 10:39:53 +0100 Subject: [PATCH] fix(perf): Fix transaction setter on scope to use containing_transaction to match with getter (#1366) --- sentry_sdk/scope.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sentry_sdk/scope.py b/sentry_sdk/scope.py index fb3bee42f1..bcfbf5c166 100644 --- a/sentry_sdk/scope.py +++ b/sentry_sdk/scope.py @@ -173,9 +173,8 @@ def transaction(self, value): # transaction name or transaction (self._span) depending on the type of # the value argument. self._transaction = value - span = self._span - if span and isinstance(span, Transaction): - span.name = value + if self._span and self._span.containing_transaction: + self._span.containing_transaction.name = value @_attr_setter def user(self, value):