What this thread does
Do first: Run pip install llama-index-observability-otel.
When you need it
The integration traces events from LlamaIndex components, including LLMs, agents and RAG pipelines. It exports native instrumentation events in OpenTelemetry format.
Steps
1. Install the integration:
pip install llama-index-observability-otel
2. Import the integration and create the instrumentation object:
from llama_index.observability.otel import LlamaIndexOpenTelemetry
instrumentor = LlamaIndexOpenTelemetry()
3. Start registering before the pipeline operations:
instrumentor.start_registering()
4. Use the page's imports and model definitions for its RAG example:
from llama_index.core import SimpleDirectoryReader, VectorStoreIndex
from llama_index.llms.openai import OpenAI
from llama_index.embeddings.openai import OpenAIEmbedding
embed_model = OpenAIEmbedding(model_name="text-embedding-3-small")
llm = OpenAI(model="gpt-4.1-mini")
5. After registration, load the example documents, build the index and query it:
documents = SimpleDirectoryReader(
input_dir="./data/paul_graham/"
).load_data()
index = VectorStoreIndex.from_documents(documents, embed_model=embed_model)
query_engine = index.as_query_engine(llm=llm)
query_result_one = query_engine.query("Who is Paul?")
query_result_two = query_engine.query("What did Paul do?")
Check it worked
Look at call traces for indexing and querying, the inspection target described on the page. The OpenTelemetry section supplies no separate success command or expected console output.
Limits
The page places observability in the instrumentation module, available in v0.10.20 and later. It does not name a version for the OpenTelemetry integration package. The RAG example expects documents in ./data/paul_graham/ and uses the model names shown above.
Not for: choosing cost-reduction changes from RAG observations; see llamaindex-observe-cut-rag-pipeline-costs.
Sources
- Observability, LlamaIndex documentation, read 2026-11-24: "View call traces for both indexing and querying"
Checked
2026-11-24; read <https://developers.llamaindex.ai/python/framework/module_guides/observability/#opentelemetry>; no command was run.
Started from a post by @LlamaIndex, packaged by the editor. Original post