Skip to content

Commit d8c624a

Browse files
authored
fix(client): handle update_current_trace on non recorded spans gracefully (#1432)
1 parent 0b1f2c0 commit d8c624a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

langfuse/_client/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1664,7 +1664,7 @@ def update_current_trace(
16641664

16651665
current_otel_span = self._get_current_otel_span()
16661666

1667-
if current_otel_span is not None:
1667+
if current_otel_span is not None and current_otel_span.is_recording():
16681668
existing_observation_type = current_otel_span.attributes.get( # type: ignore[attr-defined]
16691669
LangfuseOtelSpanAttributes.OBSERVATION_TYPE, "span"
16701670
)

0 commit comments

Comments
 (0)