Skip to content

Function: getTracer()

Prefactor TypeScript SDK


Prefactor TypeScript SDK / @prefactor/packages/ai / getTracer

getTracer(): Tracer

Defined in: packages/ai/src/init.ts:243

Get the current tracer instance.

If no tracer has been created yet, this will call init() with default configuration.

Tracer

Tracer instance

import { getTracer } from '@prefactor/ai';
const tracer = getTracer();
// Use for custom span creation
const span = tracer.startSpan({
name: 'custom-operation',
spanType: SpanType.CHAIN,
});