OfflineJudgmentSpanProcessor
Span processor used by ``OfflineTracer``.
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 example_fields configured at init time.
Attributes
tracer
tracer
_maybe_create_example()
def _maybe_create_example(span) -> None:Parameters
span
required:ReadableSpan
Returns
None
on_end()
def on_end(span) -> None:Parameters
span
required:ReadableSpan
Returns
None
state_set()
Store a value in the mutable state for a span.
def state_set(span_context, key, value) -> None:Parameters
span_context
required:SpanContext
key
required:str
value
required:Any
Returns
None
state_get()
Retrieve a value from the mutable state for a span.
def state_get(span_context, key, default=None) -> Any:Parameters
span_context
required:SpanContext
key
required:str
default
:Any
None
Returns
Any
state_incr()
Atomically increment a counter. Returns the value before increment.
def state_incr(span_context, key) -> int:Parameters
span_context
required:SpanContext
key
required:str
Returns
int
state_append()
Atomically append to a list. Returns the new list.
def state_append(span_context, key, item) -> list[Any]:Parameters
span_context
required:SpanContext
key
required:str
item
required:Any
Returns
list[Any]
emit_partial()
Export the current span's in-progress state for streaming updates.
def emit_partial() -> None:Returns
None
on_start()
def on_start(span, parent_context=None) -> None:Parameters
span
required:Span
parent_context
:Optional[Context]
None
Returns
None