/**
 * OpenTelemetry Tracer (Lightweight)
 *
 * Manual OTLP HTTP JSON exporter without @opentelemetry/* dependencies.
 * Buffers spans in memory and flushes them to an OTLP-compatible endpoint.
 *
 * Enable via:
 * - OTEL_ENDPOINT env var
 * - --otel-endpoint CLI flag
 * - Constructor config
 */
export interface OtelAttribute {
    key: string;
    value: {
        stringValue?: string;
        intValue?: number;
        boolValue?: boolean;
    };
}
export interface OtelSpanStatus {
    code: number;
    message?: string;
}
export interface OtelSpan {
    traceId: string;
    spanId: string;
    parentSpanId?: string;
    name: string;
    kind: number;
    startTimeUnixNano: string;
    endTimeUnixNano: string;
    attributes: OtelAttribute[];
    status: OtelSpanStatus;
}
export interface OtelTracerConfig {
    /** OTLP HTTP endpoint (e.g., http://localhost:4318/v1/traces) */
    endpoint?: string;
    /** Service name reported in telemetry */
    serviceName?: string;
    /** Enable/disable the tracer */
    enabled?: boolean;
    /** Flush interval in milliseconds (default: 30000) */
    flushIntervalMs?: number;
    /** Maximum buffer size before auto-flush (default: 100) */
    maxBufferSize?: number;
}
export declare class OtelTracer {
    private readonly endpoint;
    private readonly serviceName;
    private readonly enabled;
    private readonly maxBufferSize;
    private buffer;
    private flushTimer;
    private currentTraceId;
    constructor(config?: OtelTracerConfig);
    /**
     * Start a new span. Call endSpan() when the operation completes.
     */
    startSpan(name: string, attributes?: Record<string, string | number | boolean>): OtelSpan;
    /**
     * End a span and add it to the buffer for flushing.
     */
    endSpan(span: OtelSpan, status?: OtelSpanStatus): void;
    /**
     * Flush buffered spans to the OTLP endpoint.
     */
    flush(): Promise<void>;
    /**
     * Trace an LLM API call.
     */
    traceApiCall(model: string, tokens: number, duration: number): void;
    /**
     * Trace a tool execution.
     */
    traceToolExecution(toolName: string, duration: number, success: boolean): void;
    /**
     * Trace a conversation turn.
     */
    traceConversation(sessionId: string, messageCount: number): void;
    /**
     * Start a new trace (generates a new traceId).
     */
    newTrace(): string;
    /**
     * Get the number of buffered spans.
     */
    get pendingSpans(): number;
    /**
     * Check if the tracer is enabled.
     */
    get isEnabled(): boolean;
    /**
     * Dispose the tracer, flushing remaining spans.
     */
    dispose(): Promise<void>;
}
export declare function getOtelTracer(config?: OtelTracerConfig): OtelTracer;
export declare function resetOtelTracer(): void;
