Skip to content

SpanData

Standalone span representation for observe.traces() middleware. Used when @opentelemetry/api is not installed.

attributes: Record<string, string | number | boolean | string[]>

Span attributes (framework + GenAI).


endTime: number

End timestamp (epoch ms).


optional error?: object

Error details (when status is “error”).

message: string

type: string


name: string

Span name (framework or OTel convention depending on mode).


optional parentId?: string

Parent span ID (undefined for root spans).


spanId: string

16-char hex span identifier.


startTime: number

Start timestamp (epoch ms).


status: "error" | "ok"

Span completion status.


traceId: string

32-char hex trace identifier.