Skip to Content
Judgment Labs
TraceProcessors

JudgmentBaggageProcessor

Copies OTel baggage entries onto span attributes at span start.

Prop

Type

Copies OTel baggage entries onto span attributes at span start.

When a span starts, this processor reads all baggage from the parent context and sets matching entries as span attributes. Use baggage_key_predicate to control which keys are propagated.

Allow only Judgment-prefixed baggage keys:

from judgeval.trace.processors import JudgmentBaggageProcessor

processor = JudgmentBaggageProcessor(
    baggage_key_predicate=lambda k: k.startswith("judgment."),
)

__init__()

def __init__(baggage_key_predicate=ALLOW_ALL_BAGGAGE_KEYS) -> None:

Parameters

Prop

Type

Returns

None


on_start()

def on_start(span, parent_context=None) -> None:

Parameters

Prop

Type

Returns

None


on_end()

def on_end(span) -> None:

Parameters

Prop

Type

Returns

None


shutdown()

def shutdown() -> None:

Returns

None


force_flush()

def force_flush(timeout_millis=30000) -> bool:

Parameters

Prop

Type

Returns

bool

On this page