Skip to content

Commit 1ed7175

Browse files
committed
Set span status to OK when span is finished without an status set
1 parent 386e9ac commit 1ed7175

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sentry_sdk/tracing.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,6 +1582,9 @@ def is_success(self):
15821582

15831583
def finish(self, end_timestamp=None):
15841584
# type: (Optional[Union[float, datetime]]) -> Optional[str]
1585+
if hasattr(self._otel_span, "status") and self._otel_span.status.status_code == StatusCode.UNSET:
1586+
self.set_status(SPANSTATUS.OK)
1587+
15851588
if end_timestamp is not None:
15861589
from sentry_sdk.integrations.opentelemetry.utils import (
15871590
convert_to_otel_timestamp,

0 commit comments

Comments
 (0)