/**
 * Trace context for propagation across transport boundaries.
 */
export interface TraceContext {
    traceId: string;
    spanId: string;
    parentSpanId?: string;
}
/**
 * Span for tracking operations.
 */
export interface ISpan {
    traceId: string;
    spanId: string;
    name: string;
    startTime: number;
    endTime?: number;
    attributes: Record<string, unknown>;
    status: 'ok' | 'error';
    parentSpanId?: string;
    end(): void;
    setAttribute(key: string, value: unknown): void;
    setStatus(status: 'ok' | 'error', message?: string): void;
}
/**
 * Enable or disable tracing.
 */
export declare function setTracingEnabled(enabled: boolean): void;
/**
 * Check if tracing is enabled.
 */
export declare function isTracingEnabled(): boolean;
/**
 * Start a new span. If tracing is disabled, returns a no-op span.
 */
export declare function startSpan(name: string, parentContext?: TraceContext): ISpan;
/**
 * Get the current active span's trace context.
 */
export declare function getActiveTraceContext(): TraceContext | undefined;
/**
 * Extract trace context from a message payload.
 */
export declare function extractTraceContext(payload: unknown): TraceContext | undefined;
/**
 * Inject trace context into a message payload.
 */
export declare function injectTraceContext<T>(payload: T): T;
/**
 * Run a function with a span, automatically ending it.
 */
export declare function withSpan<T>(name: string, fn: (span: ISpan) => Promise<T> | T, parentContext?: TraceContext): Promise<T>;
/**
 * Add a listener for completed spans.
 */
export declare function onSpanEnd(listener: (span: ISpan) => void): () => void;
/**
 * Get all recorded spans (for debugging).
 */
export declare function getSpans(): ISpan[];
/**
 * Clear recorded spans.
 */
export declare function clearSpans(): void;
/**
 * Print a summary of spans to console.
 */
export declare function printTraceSummary(): void;
export declare function enableConsoleExporter(): () => void;
//# sourceMappingURL=tracing.d.ts.map