PythonTracerExporters

JudgmentSpanExporter

Exports completed spans to the Judgment platform over OTLP/HTTP.

Exports completed spans to the Judgment platform over OTLP/HTTP.

This is the default exporter created by Tracer.init(). It wraps the OpenTelemetry OTLPSpanExporter and injects Judgment authentication headers automatically.

You rarely need to instantiate this directly -- Tracer.init() wires it up for you. Use it when building a custom TracerProvider.

from judgeval.trace import JudgmentSpanExporter

exporter = JudgmentSpanExporter(
    endpoint="https://api.judgmentlabs.ai/otel/v1/traces",
    api_key="jdg_...",
    organization_id="org_123",
    project_id="proj_456",
)

__init__()

def __init__(endpoint, api_key, organization_id, project_id):

Parameters

endpoint

required

:

str

api_key

required

:

str

organization_id

required

:

str

project_id

required

:

str


export()

Send a batch of spans to Judgment.

def export(spans) -> SpanExportResult:

Parameters

spans

required

:

Sequence[ReadableSpan]

Returns

SpanExportResult


shutdown()

Shut down the underlying OTLP exporter and release resources.

def shutdown() -> None:

Returns

None


force_flush()

Flush any queued spans within the given timeout.

def force_flush(timeout_millis=30000) -> bool:

Parameters

timeout_millis

:

int

Default:

30000

Returns

bool