import { LiveSpan } from './entities/span'; import { TraceInfo } from './entities/trace_info'; import { Trace } from './entities/trace'; /** * Internal representation to keep the state of a trace. * Uses a Map instead of TraceData to allow access by span_id. */ declare class _Trace { info: TraceInfo; spanDict: Map; constructor(info: TraceInfo); /** * Convert the internal trace representation to an MLflow Trace object */ toMlflowTrace(): Trace; } /** * Manage spans and traces created by the tracing system in memory. * This class is implemented as a singleton. */ export declare class InMemoryTraceManager { private static _instance; private _traces; private _otelIdToMlflowTraceId; lastActiveTraceId: string | undefined; /** * Singleton pattern implementation */ static getInstance(): InMemoryTraceManager; private constructor(); /** * Register a new trace info object to the in-memory trace registry. * @param otelTraceId The OpenTelemetry trace ID for the new trace * @param traceInfo The trace info object to be stored */ registerTrace(otelTraceId: string, traceInfo: TraceInfo): void; /** * Store the given span in the in-memory trace data. * @param span The span to be stored */ registerSpan(span: LiveSpan): void; /** * Get the trace for the given trace ID. * Returns the trace object or null if not found. * @param traceId The trace ID to look up */ getTrace(traceId: string): _Trace | null; /** * Get the MLflow trace ID for the given OpenTelemetry trace ID. * @param otelTraceId The OpenTelemetry trace ID */ getMlflowTraceIdFromOtelId(otelTraceId: string): string | null; /** * Get the span for the given trace ID and span ID. * @param traceId The trace ID * @param spanId The span ID */ getSpan(traceId?: string | null, spanId?: string | null): LiveSpan | null; /** * Pop trace data for the given OpenTelemetry trace ID and return it as * a ready-to-publish Trace object. * @param otelTraceId The OpenTelemetry trace ID */ popTrace(otelTraceId: string): Trace | null; /** * Clear all the aggregated trace data. This should only be used for testing. */ static reset(): void; } export {};