import type { RuntimeTracer, TraceEvent, TraceRecord } from '../core/tracing';
export interface OtlpExporterOptions {
    /** Base URL, e.g. http://localhost:4318. The exporter appends /v1/traces. */
    endpoint?: string;
    /** Optional auth token, sent as `Authorization: <token>`. */
    authorization?: string;
    /** Process trace id; used to group all spans into one trace. */
    traceIdHex?: string;
    /** Service name reported in the OTLP resource. */
    serviceName?: string;
    /** Service version reported in the OTLP resource. */
    serviceVersion?: string;
    /** Extra OTLP resource attributes. */
    resourceAttributes?: Record<string, unknown>;
    /** Max time between flushes (ms). Default 5_000. */
    flushIntervalMs?: number;
    /** Eager flush after this many queued spans/events. Default 32. */
    flushThreshold?: number;
    /** Override fetch (mainly for tests). */
    fetchImpl?: typeof fetch;
    /** Console for warnings. Tests can mute it. */
    logger?: {
        warn: (message: string, meta?: Record<string, unknown>) => void;
    };
}
export interface OtlpExporter {
    /** Queue a span record for export. */
    enqueueSpan(span: TraceRecord): void;
    /** Queue an event record for export. */
    enqueueEvent(event: TraceEvent): void;
    /** Force a flush; resolves once the HTTP call completes (or skips). */
    flush(): Promise<{
        exported: number;
        ok: boolean;
        error?: string;
    }>;
    /** Stop the timer + flush remaining items once. */
    shutdown(): Promise<void>;
    /** Snapshot of queue + last-call diagnostics. */
    status(): {
        queued: number;
        lastError?: string;
        lastSuccessAt?: string;
    };
}
export declare function createOtlpExporter(options?: OtlpExporterOptions): OtlpExporter;
/**
 * Attach an OTLP exporter to a RuntimeTracer so every newly closed span
 * and recorded event flows through the exporter. Wraps the existing
 * `startSpan` / `recordEvent` methods rather than replacing them so all
 * downstream consumers keep working.
 *
 * Returns the exporter itself plus a detach() callback.
 */
export interface AttachOptions extends OtlpExporterOptions {
    exporter?: OtlpExporter;
}
export declare function attachOtlpExporter(tracer: RuntimeTracer, options?: AttachOptions): {
    exporter: OtlpExporter;
    detach: () => Promise<void>;
};
//# sourceMappingURL=otlpExporter.d.ts.map