Primary entry point for Fiddler AI observability in JavaScript/TypeScript.
Creates an isolated OpenTelemetry BasicTracerProvider that exports
traces to the Fiddler backend via OTLP HTTP. The provider is not
registered globally, so it will not interfere with other OTel
instrumentation in the same process.Node.js only — registers a process.beforeExit handler for
automatic shutdown. The process guard is safe in non-Node
environments, but @fiddler-ai/otel requires Node.js >= 20.
Methods
constructor(config: FiddlerClientConfig)
Create a new Fiddler client and initialize the OTel provider.
FiddlerClientConfig
required
Client configuration including Fiddler URL, API key,
and application ID.
async flush(): Promise<void>
Force-flush all buffered spans to the Fiddler backend.Call this before process exit in short-lived scripts to ensure all
spans are exported.
async shutdown(): Promise<void>
Flush remaining spans and shut down the underlying OTel provider.After shutdown the client cannot create new spans. This method is
idempotent — calling it multiple times is safe.