TracerConfig
Configuration options for initializing a Tracer. Credentials are resolved in order: explicit arguments first, then environment variables.
Configuration options for initializing a Tracer.
Credentials are resolved in order: explicit arguments first, then environment variables.
Properties
projectName
:string | undefined
Your Judgment project name. Required for span export.
apiKey
:string | undefined
Judgment API key. Defaults to JUDGMENT_API_KEY env var.
organizationId
:string | undefined
Judgment organization ID. Defaults to JUDGMENT_ORG_ID env var.
apiUrl
:string | undefined
Judgment API URL. Defaults to JUDGMENT_API_URL env var.
environment
:string | undefined
Deployment environment name (e.g. "production").
setActive
:boolean | undefined
Whether to automatically set this tracer as active. Defaults to true.
serializer
:((value: unknown) => string) | undefined
Custom serialization function for span attribute values.
resourceAttributes
:Record<string, string> | undefined
Additional OpenTelemetry resource attributes.
sampler
:Sampler | undefined
Custom OpenTelemetry sampler. Defaults to the SDK's default.
spanLimits
:SpanLimits | undefined
Custom OpenTelemetry span limits (attribute/event/link caps).
spanProcessors
:SpanProcessor[] | undefined
Additional span processors to register alongside Judgment's own processor.
Tracer
Concrete tracer implementation for Node.js applications. Use `Tracer.init()` to create and activate a new tracer. This sets up OpenTelemetry span processing and export to the Judgment platform.
OfflineTracer
Tracer for offline / experiment-style runs. Behaves like `Tracer` for span creation and `@Tracer.observe`, with two differences: * Spans are pushed to the project's *offline* OTLP endpoint and stored in the `offline_otel_traces` ClickHouse table. They do **not** appear on the live monitoring page. * Each completed root span produces a new `Example` that is appended to the caller-supplied `dataset` list. The example carries the `offline_trace_id` of the offline trace plus any static `exampleFields` configured at init time. Unlike `Tracer`, `OfflineTracer` requires all credentials upfront and throws if any are missing — there is no no-op fallback. Prefer `judgeval.offlineTracer({ ... })` over calling `OfflineTracer.create` directly so credentials are reused from the active `Judgeval` client.
Last updated on