diff --git a/sentry_sdk/scope.py b/sentry_sdk/scope.py index b4274a4e7c..e6ad86254f 100644 --- a/sentry_sdk/scope.py +++ b/sentry_sdk/scope.py @@ -1031,9 +1031,8 @@ def start_transaction( transaction._profile = profile - # we don't bother to keep spans if we already know we're not going to - # send the transaction - if transaction.sampled: + # we don't bother to keep spans if we already know we're not going to + # send the transaction max_spans = (client.options["_experiments"].get("max_spans")) or 1000 transaction.init_span_recorder(maxlen=max_spans)