Skip to content
Judgment Labs
Esc
↑↓navigate↵open⌘Jpreview
On this page

JudgmentSpanExporter

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

PropType
endpointstr
Typestr
api_keystr
Typestr
organization_idstr
Typestr
project_idstr
Typestr

export()

Send a batch of spans to Judgment.

def export(spans) -> SpanExportResult:

Parameters

PropType
spansSequence[ReadableSpan]
TypeSequence[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

PropType
timeout_millis?int
Typeint
Default30000

Returns

bool

Was this page helpful?