Skip to main content

respan-instrumentation-llama-index

Respan instrumentation plugin for LlamaIndex Core and standalone Workflows. It registers native LlamaIndex instrumentation handlers and emits Respan-compatible OpenTelemetry spans through the Respan tracing pipeline.

Configuration

1. Install

pip install respan-instrumentation-llama-index

2. Set Environment Variables

Variable Required Description
RESPAN_API_KEY Yes Your Respan API key. Authenticates both proxy and tracing.
RESPAN_BASE_URL No Defaults to https://api.respan.ai/api.

All vendor-specific variables are derived from these in your application code.

Quickstart

3. Run Script

import os

from dotenv import load_dotenv
from llama_index.core import Document, SummaryIndex, Settings
from llama_index.llms.openai import OpenAI
from respan import Respan
from respan_instrumentation_llama_index import LlamaIndexInstrumentor

load_dotenv()

respan_api_key = os.environ["RESPAN_API_KEY"]
respan_base_url = os.getenv("RESPAN_BASE_URL", "https://api.respan.ai/api")

os.environ["OPENAI_API_KEY"] = respan_api_key
os.environ["OPENAI_BASE_URL"] = respan_base_url
os.environ["OPENAI_API_BASE"] = respan_base_url

respan = Respan(
    api_key=respan_api_key,
    base_url=respan_base_url,
    app_name="llama-index-quickstart",
    instrumentations=[LlamaIndexInstrumentor()],
)

Settings.llm = OpenAI(
    model="gpt-4o-mini",
    api_key=respan_api_key,
    api_base=respan_base_url,
)
index = SummaryIndex.from_documents(
    [Document(text="Respan captures traces from LlamaIndex applications.")]
)
query_engine = index.as_query_engine()

try:
    response = query_engine.query("What does Respan capture?")
    print(response)
finally:
    respan.shutdown()

4. View Dashboard

After running the script, traces appear on your Respan dashboard.

Further Reading

See the python/tracing/llama-index examples for runnable scripts covering Core LLM, embedding, retrieval, and agent APIs, plus standalone Workflows success and failure paths.

Metadata

Release files for respan-instrumentation-llama-index 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for respan-instrumentation-llama-index 0.1.1
File Size Uploaded
respan_instrumentation_llama_index-0.1.1.tar.gz 11.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for respan-instrumentation-llama-index 0.1.1
File Interpreter ABI Platform
respan_instrumentation_llama_index-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 24.0 kB

Release files / respan_instrumentation_llama_index-0.1.1.tar.gz

Download URL respan_instrumentation_llama_index-0.1.1.tar.gz
Size 11.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ddadab722fd4e04080f7bbeecc7aa136adbbcf80f2fb81c873a80c9214c1de00
BLAKE2b-256 checksum
How to use checksums
4acb142c645c410c4a5855e5355c090922afc91b785a91e783081f9b95ef32f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / respan_instrumentation_llama_index-0.1.1-py3-none-any.whl

Download URL respan_instrumentation_llama_index-0.1.1-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
40f9303af1a5f6cb91d8919054389fc5071be25ade26b215d86a32f129c84bbd
BLAKE2b-256 checksum
How to use checksums
2d31f816508e763e94f8a217f6e4130caf906e04e629a75eed073e1fbed3e1b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page