/** * Request Tracing * * Distributed tracing with span support. */ import type { Span } from './types.js'; /** * Tracer for creating and managing spans. */ export declare class Tracer { private currentTraceId?; private currentSpan?; private spans; /** * Generate a unique request ID. */ generateRequestId(): string; /** * Start a new span. */ startSpan(name: string, attributes?: Record): Span; /** * Start a new trace (top-level span). */ startTrace(name: string, attributes?: Record): Span; /** * Get current trace ID. */ getTraceId(): string | undefined; /** * Set trace ID for correlation with external systems. */ setTraceId(traceId: string): void; /** * Get current span. */ getCurrentSpan(): Span | undefined; /** * Get all recorded spans. */ getSpans(): Span[]; /** * Clear recorded spans. */ clearSpans(): void; /** * Clear current context. */ clearContext(): void; /** * Execute a function within a span. */ withSpan(name: string, fn: (span: Span) => Promise, attributes?: Record): Promise; /** * Export spans as JSON. */ exportSpans(): Record[]; } /** * Get or create global tracer. */ export declare function getTracer(): Tracer; /** * Create a new tracer instance. */ export declare function createTracer(): Tracer; //# sourceMappingURL=tracer.d.ts.map