Prerequisites
- Python 3.9+
- OpenAI API key
- Phoenix or another OpenTelemetry collector
Installation
Instrumentation Setup
First, create an instrumentation module:Complete Query Engine Example
Chat Engine Example
LlamaIndex also provides chat engines for conversational applications:Streaming Responses
Key Features
Automatic Tracing
LlamaIndex instrumentation captures:- Query execution: Full query pipeline from input to output
- Retrieval: Document retrieval with similarity scores
- LLM calls: All calls to language models
- Embeddings: Embedding generation for queries and documents
- Node processing: Document chunking and indexing
Resource Attributes
Use resource attributes to organize projects:Memory and Context
The instrumentation tracks:- Conversation history in chat engines
- Context window management
- Memory buffer operations
Production Setup
For production deployments:Next Steps
- Learn about agent patterns
- Explore custom retrievers
- See production deployment