UNPKG

@vfarcic/dot-ai

Version:

AI-powered development productivity platform that enhances software development workflows through intelligent automation and AI-driven assistance

68 lines 2.26 kB
/** * Qdrant Vector Database Tracing * * Provides distributed tracing instrumentation for Qdrant vector database operations. * Creates CLIENT spans with database semantic conventions and vector-specific attributes. */ /** * Vector database operation types */ export type VectorDBOperation = 'collection.create' | 'collection.get' | 'collection.list' | 'collection.delete' | 'collection.initialize' | 'vector.upsert' | 'vector.search' | 'vector.search_keywords' | 'vector.scroll_filtered' | 'vector.retrieve' | 'vector.delete' | 'vector.delete_all' | 'vector.list' | 'health_check'; /** * Qdrant operation metadata for tracing */ export interface QdrantOperationContext { /** Operation type */ operation: VectorDBOperation; /** Collection name */ collectionName: string; /** Vector dimensions (for upsert, search operations) */ vectorSize?: number; /** Search limit (for search operations) */ limit?: number; /** Score threshold (for similarity search) */ scoreThreshold?: number; /** Number of keywords (for keyword search) */ keywordCount?: number; /** Document ID (for single document operations) */ documentId?: string; /** Qdrant server URL */ serverUrl?: string; } /** * Generic Qdrant operation tracing wrapper * * @param operationContext - Qdrant operation metadata * @param handler - Async operation to trace * @returns Result from handler * * @example * ```typescript * // Trace vector search * const results = await withQdrantTracing( * { * operation: 'vector.search', * collectionName: 'capabilities', * vectorSize: 1536, * limit: 10, * scoreThreshold: 0.5, * serverUrl: 'http://localhost:6333' * }, * async () => await this.client.search(...) * ); * * // Trace document upsert * await withQdrantTracing( * { * operation: 'vector.upsert', * collectionName: 'patterns', * documentId: 'pattern-123', * vectorSize: 384, * serverUrl: 'http://localhost:6333' * }, * async () => await this.client.upsert(...) * ); * ``` */ export declare function withQdrantTracing<T>(operationContext: QdrantOperationContext, handler: () => Promise<T>): Promise<T>; //# sourceMappingURL=qdrant-tracing.d.ts.map