import { PrivacyConfig } from "../core/privacy.js"; import { AmplitudeClientLike } from "../types.js"; //#region src/otel/mapper.d.ts interface OtelSpanEvent { name?: string; attributes?: Record; } interface OtelSpan { name?: string; attributes?: Record; startTime?: [number, number]; endTime?: [number, number]; start_time?: number; end_time?: number; startTimeUnixNano?: bigint | number; endTimeUnixNano?: bigint | number; status?: { code?: number; message?: string; }; context?: { trace_id?: number; span_id?: number; traceId?: string; spanId?: string; }; spanContext?: () => { traceId?: string; spanId?: string; }; parent?: { span_id?: number; spanId?: string; }; parentSpanId?: string; events?: OtelSpanEvent[]; } /** * Which spans become events. `'genai'` (default) maps only spans carrying a * `gen_ai.*` or `amplitude.*` attribute; `'all'` also maps every other span * in the process (HTTP, DB, ...) as `[Agent] Span`. */ type OtelSpanFilter = 'genai' | 'all'; interface SpanEventMapperOptions { amplitude: AmplitudeClientLike; defaultUserId?: string | null; defaultDeviceId?: string | null; privacyConfig?: PrivacyConfig | null; otelSpanFilter?: OtelSpanFilter; } declare class SpanEventMapper { private readonly _amplitude; private readonly _defaultUserId; private readonly _defaultDeviceId; private readonly _privacyConfig; private readonly _spanFilter; constructor(options: SpanEventMapperOptions); mapAndTrack(span: OtelSpan): void; private _mapAndTrackInner; private _routeExplicitType; private _routeGenaiOperation; private _routeSpanKind; private _buildExtraProperties; private _extractUserContent; private _extractAiContent; private _extractSystemPrompt; private _extractIoState; private _resolveUserId; private _extractOtelTraceId; private _extractOtelSpanId; private _extractParentSpanId; private _computeLatencyMs; private _parseContextAttr; } //#endregion export { OtelSpan, OtelSpanEvent, OtelSpanFilter, SpanEventMapper, SpanEventMapperOptions }; //# sourceMappingURL=mapper.d.ts.map