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
Type
strapi_keystr
Type
strorganization_idstr
Type
strproject_idstr
Type
strexport()
Send a batch of spans to Judgment.
def export(spans) -> SpanExportResult:
Parameters
PropType
spansSequence[ReadableSpan]
Type
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
PropType
timeout_millis?int
Type
intDefault
30000Returns
bool