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