Skip to main content
Available for: Python and TypeScript.
Calling Qdrant directly (no LangChain/LlamaIndex retriever abstraction in between) previously got zero automatic tracing — only the manual recordRetrieval/record_retrieval helper. Zespan now patches QdrantClient so every query and upsert() call is captured automatically, the same way LLM provider calls already are.
Patched automatically as part of zespan.autopatch(), which both SDKs run on init() unless you pass autopatch: false (autopatch=False in Python). There’s no separate opt-in call for vector-DB tracing.

What gets traced

  • Reads — Python: query_points() only, on both QdrantClient (sync) and AsyncQdrantClient. The Python client’s .search() method was removed entirely in current qdrant-client versions, so there’s nothing to patch there. Node: both client.search() and client.query() are patched — the JS client still ships both methods, so either style is traced
  • Writesupsert() (sync and async in Python; single method in Node) emits an embedding span

Installation

Usage

AsyncQdrantClient is patched the same way — await client.query_points(...) and await client.upsert(...) are traced identically to the sync calls above.

What gets captured

content follows your storePrompts/store_prompts setting and the same redaction rules as prompt text — set storePrompts: false and payload text is dropped while document_id/source/score are still kept.

Write span (upsert()) — span_kind: "embedding", operation: "vector_upsert"

Linking a Qdrant query to a following LLM call. Trace context (trace_id) is picked up from whatever with_zespan_context()/withZespanContext() scope is active when the query/upsert() runs — the same rule every other Zespan wrapper follows. If your Qdrant call and your LLM call are two independent, unwrapped top-level calls, they land on two different traces, and RAG evaluators/the Retrieval panel won’t see the connection between them. Wrap both in the same with_zespan_context()/withZespanContext() block, exactly like the complete RAG pipeline example in Manual spans.

Next steps

  • Manual spans — the record_vector_search()/recordVectorSearch() helper for pgvector, and the full with_zespan_context()/withZespanContext() trace-linking pattern
  • Evaluating RAG pipelines — score retrieval quality once rag_contexts is on the trace
  • Pinecone, Chroma, Weaviate — the other auto-traced vector DBs