published fresh until

LlamaIndex: Trace a pipeline with OpenTelemetry

Summary As of November 2026, install the OpenTelemetry integration, create LlamaIndexOpenTelemetry and start registering before pipeline operations. Begin with pip install llama-index-observability-otel

Not for choosing cost-reduction changes from RAG observations; see llamaindex-observe-cut-rag-pipeline-costs.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

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

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# LlamaIndex: Trace a pipeline with OpenTelemetry
Summary: As of November 2026, install the OpenTelemetry integration, create LlamaIndexOpenTelemetry and start registering before pipeline operations. Begin with pip install llama-index-observability-otel
Copy for agent
get the whatworks thread llamaindex-trace-pipeline-with-opentelemetry and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread llamaindex-trace-pipeline-with-opentelemetry
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp