From ad035d1b6f005dcf446e7bb2b4efcb08453b3815 Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Tue, 17 Dec 2024 14:04:27 +0100 Subject: [PATCH] Forgot unset --- sentry_sdk/tracing.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sentry_sdk/tracing.py b/sentry_sdk/tracing.py index 79220592c5..87868eb95f 100644 --- a/sentry_sdk/tracing.py +++ b/sentry_sdk/tracing.py @@ -1595,7 +1595,9 @@ def status(self): if not hasattr(self._otel_span, "status"): return None - if self._otel_span.status.status_code == StatusCode.OK: + if self._otel_span.status.status_code == StatusCode.UNSET: + return None + elif self._otel_span.status.status_code == StatusCode.OK: return SPANSTATUS.OK else: return SPANSTATUS.UNKNOWN_ERROR