Interface: Span
Prefactor TypeScript SDK / @prefactor/core / Span
Interface: Span
Section titled “Interface: Span”Defined in: packages/core/src/tracing/span.ts:56
A span represents a single operation in a trace
Properties
Section titled “Properties”spanId
Section titled “spanId”spanId:
string
Defined in: packages/core/src/tracing/span.ts:58
Unique identifier for this span
parentSpanId
Section titled “parentSpanId”parentSpanId:
string|null
Defined in: packages/core/src/tracing/span.ts:61
ID of the parent span, or null if this is a root span
traceId
Section titled “traceId”traceId:
string
Defined in: packages/core/src/tracing/span.ts:64
Trace ID shared by all spans in a single trace
name:
string
Defined in: packages/core/src/tracing/span.ts:67
Human-readable name for this span
spanType
Section titled “spanType”spanType:
string
Defined in: packages/core/src/tracing/span.ts:70
Type of operation this span represents
startTime
Section titled “startTime”startTime:
number
Defined in: packages/core/src/tracing/span.ts:73
Start time in milliseconds since Unix epoch
endTime
Section titled “endTime”endTime:
number|null
Defined in: packages/core/src/tracing/span.ts:76
End time in milliseconds since Unix epoch, or null if still running
status
Section titled “status”status:
SpanStatus
Defined in: packages/core/src/tracing/span.ts:79
Current status of the span
inputs
Section titled “inputs”inputs:
Record<string,unknown>
Defined in: packages/core/src/tracing/span.ts:82
Input data for this operation
outputs
Section titled “outputs”outputs:
Record<string,unknown> |null
Defined in: packages/core/src/tracing/span.ts:85
Output data from this operation, or null if not completed
tokenUsage
Section titled “tokenUsage”tokenUsage:
TokenUsage|null
Defined in: packages/core/src/tracing/span.ts:88
Token usage for LLM calls, or null if not applicable
error:
ErrorInfo|null
Defined in: packages/core/src/tracing/span.ts:91
Error information if the span failed, or null if successful
metadata
Section titled “metadata”metadata:
Record<string,unknown>
Defined in: packages/core/src/tracing/span.ts:94
Additional metadata about this span