Skip to main content

SpanStatus

Allowed status values for a Span.

Overview

SpanStatus defines the lifecycle states a span can be in. Every span has a status that indicates whether the operation completed, failed, or was interrupted. The default status is "unknown".

Import

Type Definition

SpanStatus is a str literal with the following allowed values:
SpanStatus does not include "pending". Unlike TraceStatus, spans represent discrete operations that are either complete or not — use "unknown" until the span resolves.

Usage

Setting status on a new span

Updating status after an LLM call


Comparison with TraceStatus


  • Span — the class that uses SpanStatus
  • TraceStatus — the equivalent status type for traces (includes "pending")
  • Trace — parent container for spans