Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

respan_instrumentation_chroma-0.1.0.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

respan_instrumentation_chroma-0.1.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file respan_instrumentation_chroma-0.1.0.tar.gz.

File metadata

File hashes

Hashes for respan_instrumentation_chroma-0.1.0.tar.gz
Algorithm Hash digest
SHA256 75622e05f013f55613e2fb820ac1f697324e221edeef4f602dc8e77bb8617bc9
MD5 88601dd3be3c1b7ea7d1d92055a8da22
BLAKE2b-256 29a5de07171e8114558bf02d2811bfe7664db44d961830baa8bceb73976f9d2a

See more details on using hashes here.

File details

Details for the file respan_instrumentation_chroma-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for respan_instrumentation_chroma-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 26e29b7ae65e6bf6bcca4aa107dbdbc2b71292bd742aa396a0b304ad998f16f6
MD5 622b7c246afbc4ae9b4c25273e9c0d6e
BLAKE2b-256 c8197cf81536d7cbe2683ddb07daac05b18c948047248c81eea93d405ccc1f3c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page