From 9d97d93a7a3ccfef3f4796b5429716188e4aaec1 Mon Sep 17 00:00:00 2001 From: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com> Date: Wed, 10 Jul 2024 15:58:27 +0200 Subject: [PATCH] ref: Stop using `Hub` in `tracing_utils` (#3269) Get the client via `sentry_sdk.get_client()` instead. Prerequisite for #3265 --- sentry_sdk/tracing_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sentry_sdk/tracing_utils.py b/sentry_sdk/tracing_utils.py index a3a03e65c1..ba20dc8436 100644 --- a/sentry_sdk/tracing_utils.py +++ b/sentry_sdk/tracing_utils.py @@ -492,9 +492,9 @@ def from_options(cls, scope): third_party_items = "" mutable = False - client = sentry_sdk.Hub.current.client + client = sentry_sdk.get_client() - if client is None or scope._propagation_context is None: + if not client.is_active() or scope._propagation_context is None: return Baggage(sentry_items) options = client.options