Registry /
observability / opentelemetry-instrumentation-qdrant
Install & Compatibility
Where this runs
tested against v0.62.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 4.870s · 137.8MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 9.7s · import 3.866s · 131MB
138MB installed
● package 138MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
QdrantInstrumentor
✓ from opentelemetry.instrumentation.qdrant import QdrantInstrumentor
This quickstart demonstrates how to set up OpenTelemetry to automatically trace Qdrant client operations. It initializes a basic `TracerProvider` with a `ConsoleSpanExporter`, instruments the Qdrant client, performs a `recreate_collection`, `upsert`, and `search` operation using an in-memory Qdrant client, and then shuts down the tracer provider to ensure all spans are exported.
import os
from opentelemetry import trace
from opentelemetry.sdk.resources import Resource
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import ConsoleSpanExporter, SimpleSpanProcessor
from opentelemetry.instrumentation.qdrant import QdrantInstrumentor
from qdrant_client import QdrantClient, models
# 1. Setup OpenTelemetry Tracer Provider and Exporter
resource = Resource.create({"service.name": "qdrant-example-app"})
provider = TracerProvider(resource=resource)
processor = SimpleSpanProcessor(ConsoleSpanExporter())
provider.add_span_processor(processor)
trace.set_tracer_provider(provider)
# 2. Instrument Qdrant (must be called before client initialization)
QdrantInstrumentor().instrument()
# 3. Use Qdrant Client (operations will be automatically traced)
# Using an in-memory client for a self-contained example
client = QdrantClient(":memory:") # Use ":memory:" for a local, ephemeral instance
collection_name = "my_test_collection"
vector_size = 4
print(f"Creating collection: {collection_name}")
client.recreate_collection(
collection_name=collection_name,
vectors_config=models.VectorParams(size=vector_size, distance=models.Distance.COSINE),
)
print("Upserting points...")
client.upsert(
collection_name=collection_name,
wait=True,
points=[
models.PointStruct(id=1, vector=[0.05, 0.61, 0.76, 0.74], payload={"city": "Berlin"}),
models.PointStruct(id=2, vector=[0.19, 0.81, 0.75, 0.11], payload={"city": "London"})
],
)
print("Searching points...")
search_result = client.search(
collection_name=collection_name,
query_vector=[0.2, 0.7, 0.9, 0.1],
limit=1,
)
print(f"Search result: {search_result}")
# 4. Ensure traces are flushed (important for ConsoleSpanExporter and script termination)
trace.get_tracer_provider().shutdown()
Upgrade
Version history
0.62.3latest on PyPI · released Aug 10, 2026
Audit
Dependencies
opentelemetry-apirequiredCore OpenTelemetry API for tracing.
opentelemetry-sdkrequiredCore OpenTelemetry SDK for trace provider and processors.
wraptrequiredUsed for function wrapping and instrumentation.
opentelemetry-semantic-conventionsrequiredProvides standard semantic conventions for span attributes.
opentelemetry-instrumentationrequiredBase package for OpenTelemetry instrumentations.
qdrant-clientoptionalThe Qdrant Python client library being instrumented. Users must install this explicitly.