API reference
yatta/otel
OpenTelemetry tracing, bridged into the observe dashboard.
6 exported symbols and 3 members, read from src/types/otel.ts.
Construct
enableOpenTelemetry
functionEnable OpenTelemetry integration.
This does NOT set up the OTel SDK — you must configure that separately (e.g., with
enableOpenTelemetry(config?: OtelConfig): voidgetOtelTracer
functionGet the OTel tracer, or null if not enabled.
getOtelTracer(): Tracer | nullisOpenTelemetryEnabled
functionCheck if OpenTelemetry bridging is enabled.
isOpenTelemetryEnabled(): booleanstartOtelSpan
functionStart an OTel span directly (for custom instrumentation).
startOtelSpan(name: string, options?: { kind?: OtelSpanKind; attributes?: Record<string, string | number | boolean>; }): OtelSpan | nullwithOtelSpan
async functionRun a function within an OTel span context.
withOtelSpan<T>(name: string, fn: (span: OtelSpan) => Promise<T>, options?: { kind?: OtelSpanKind; attributes?: Record<string, string | number | boolean>; }): Promise<T>Types
OtelConfig
interfaceinterface OtelConfig3 members
tracerNamepropertytracerName?: stringTracer name for OTel spans (default: "yatta")
versionpropertyversion?: stringTracer version
bridgeSpanspropertybridgeSpans?: booleanWhether to bridge Yatta spans to OTel (default: true)
Tip
Most of the types above are inferred. You rarely import
AuthConfig or JobPayload — declaring your schema once is enough for the rest to follow. See Typed keys.