Generative AI instrumentation for Python
If your service uses Python LLM frameworks and you want observability of generative AI operations, then you can optionally install additional packages while installing the Python library.
Before you start
Verify your service environment and install the Python library. Before loading, install instrumentation based on your environment and the list below.
Additional LLM instrumentation packages
Install additional OpenTelemetry-based instrumentation packages for the LLM framework(s) used by your service to export signals from generative AI operations. For example, do pip install opentelemetry-instrumentation-genai-openai to instrument OpenAI operations. Note that these packages are still under rapid development and may introduce breaking changes in near-future releases. You can also install OpenLLMetry instrumentation packages which are compatible with the Python library.
| LLM Framework | OpenTelemetry instrumentation |
|---|---|
| Anthropic | opentelemetry-instrumentation-genai-anthropic |
| Google GenAI | opentelemetry-instrumentation-google-genai |
| Langchain | opentelemetry-instrumentation-genai-langchain |
| OpenAI | opentelemetry-instrumentation-genai-openai |
| OpenAI Agents | opentelemetry-instrumentation-genai-openai-agents |