Quick Start
Last tested with
litellm 1.82.4 (March 2026).What Gets Traced
The instrumentor automatically captures:- Completions -
litellm.completion()andlitellm.acompletion()with inputs, outputs, and token usage - Embeddings -
litellm.embedding()andlitellm.aembedding()requests - Image generation -
litellm.image_generation()andlitellm.aimage_generation()calls - Multi-provider routing - Model name and provider metadata for every call
Example: Multi-Provider Completions
Avoiding Duplicate Spans
Environment Configuration
Troubleshooting
Traces not appearing
- Check environment variables - Ensure
HH_API_KEYis set - Pass the tracer provider - The instrumentor must receive
tracer_provider=tracer.provider:
- Use module-level calls - Call
litellm.completion(), not a directly importedcompletion()function
Related
Enrich Your Traces
Add user IDs and custom metadata to traces
Custom Spans
Create spans for business logic around API calls
Distributed Tracing
Trace calls across service boundaries

