Respan instrumentation plugin for Chroma
Project description
respan-instrumentation-chroma
Respan instrumentation plugin for Chroma Python applications.
The package adds Respan task spans for Chroma client and collection operations, including collection lifecycle calls, writes, reads, vector queries, updates, deletes, and counts. Embeddings and image payloads are summarized by count and dimension instead of being written as raw span attributes.
Configuration
1. Install
pip install respan-ai respan-instrumentation-chroma chromadb
2. Set Environment Variables
| Variable | Required | Description |
|---|---|---|
RESPAN_API_KEY |
Yes | Your Respan API key. Authenticates tracing export. |
RESPAN_BASE_URL |
No | Defaults to https://api.respan.ai/api. |
Quickstart
import chromadb
from respan import Respan, workflow
from respan_instrumentation_chroma import ChromaInstrumentor
respan = Respan(instrumentations=[ChromaInstrumentor()])
@workflow(name="chroma_query_workflow")
def run_chroma_query() -> dict:
client = chromadb.Client()
collection = client.get_or_create_collection("respan_docs")
collection.upsert(
ids=["doc-1"],
embeddings=[[0.1, 0.2, 0.3]],
documents=["Respan traces Chroma operations."],
metadatas=[{"topic": "observability"}],
)
return collection.query(
query_embeddings=[[0.1, 0.2, 0.3]],
n_results=1,
include=["documents", "metadatas", "distances"],
)
print(run_chroma_query())
respan.flush()
respan.shutdown()
Further Reading
See the Respan example projects for runnable Chroma scripts.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file respan_instrumentation_chroma-0.1.0.tar.gz.
File metadata
- Download URL: respan_instrumentation_chroma-0.1.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75622e05f013f55613e2fb820ac1f697324e221edeef4f602dc8e77bb8617bc9
|
|
| MD5 |
88601dd3be3c1b7ea7d1d92055a8da22
|
|
| BLAKE2b-256 |
29a5de07171e8114558bf02d2811bfe7664db44d961830baa8bceb73976f9d2a
|
File details
Details for the file respan_instrumentation_chroma-0.1.0-py3-none-any.whl.
File metadata
- Download URL: respan_instrumentation_chroma-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26e29b7ae65e6bf6bcca4aa107dbdbc2b71292bd742aa396a0b304ad998f16f6
|
|
| MD5 |
622b7c246afbc4ae9b4c25273e9c0d6e
|
|
| BLAKE2b-256 |
c8197cf81536d7cbe2683ddb07daac05b18c948047248c81eea93d405ccc1f3c
|