Skip to content
Judgment Labs
Esc
navigateopen⌘Jpreview
On this page

OfflineJudgmentSpanProcessor

Span processor used by `OfflineTracer`.

Extends JudgmentSpanProcessor (so it inherits batched export, span state, and partial-emit support) and additionally appends a new Example to the caller-supplied dataset list whenever a root span ends. Each emitted example carries the offline_trace_id of the trace plus any static exampleFields configured at init time.

Attributes

PropType
tracer?BaseTracer | null
TypeBaseTracer | null

stateSet()

Store a value in the mutable state for a span.

function stateSet(spanContext: SpanContext, key: string, value: unknown): void

Parameters

PropType
spanContextSpanContext
TypeSpanContext
keystring
Typestring
valueunknown
Typeunknown

Returns

void


stateGet()

Retrieve a value from the mutable state for a span.

function stateGet(spanContext: SpanContext, key: string, defaultValue: T): T

Parameters

PropType
spanContextSpanContext
TypeSpanContext
keystring
Typestring
defaultValueT
TypeT

Returns

T


stateIncr()

Atomically increment a counter. Returns the value before increment.

function stateIncr(spanContext: SpanContext, key: string): number

Parameters

PropType
spanContextSpanContext
TypeSpanContext
keystring
Typestring

Returns

number


stateAppend()

Atomically append to a list. Returns the new list.

function stateAppend(spanContext: SpanContext, key: string, item: T): T[]

Parameters

PropType
spanContextSpanContext
TypeSpanContext
keystring
Typestring
itemT
TypeT

Returns

T[]


emitPartial()

Export the current span’s in-progress state for streaming updates.

function emitPartial(): void

Returns

void

Was this page helpful?