import { ExportResult } from '@opentelemetry/core'; import { ReadableSpan as OTelReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base'; import { WalRecord } from './types'; /** * Hook-side submit function. Returns once the daemon has fsynced the * record to `queue.log` (ack-after-fsync). Injectable so tests can * swap in a stub without spinning up an actual daemon. */ export type SubmitRecord = (record: WalRecord) => Promise; /** * Asynchronous SpanExporter that decouples the user's Stop hook from * backend latency for MlflowSpanProcessor. * * {@link forceFlush} awaits only the IPC submits, *not* the upstream * upload. That gives the Stop hook the exact "trace is durable on this * machine, then return" semantics it needs to bound its runtime. */ export declare class MlflowWalSpanExporter implements SpanExporter { private _pendingSubmits; private _submit; private _shuttingDown; constructor(opts?: { submit?: SubmitRecord; }); export(spans: OTelReadableSpan[], resultCallback: (result: ExportResult) => void): void; /** * Resolves once every IPC submit that was in flight when this method * was called has been acknowledged (post-fsync). Matches OTel's * "flush currently pending" semantic — concurrent `export()` calls * during the await are not waited on, and the next `forceFlush` will * pick them up. For "drain everything before exit" semantics, use * {@link shutdown}. */ forceFlush(): Promise; /** * Stop accepting new exports and drain every in-flight IPC submit to * convergence before resolving. */ shutdown(): Promise; }