OneAgent provides automatic, zero-instrumentation observability for AI applications. With OneAgent running on the host, Dynatrace captures GenAI-specific attributes (such as the model name, token counts, latency, and prompt content) without any changes to your application code. No instrumentation libraries or SDK wrappers are required.
This guide covers Python AI SDKs for AWS Bedrock, OpenAI, and LangChain, and provides guidance for other supported providers.
This getting started guide is for:
By following this guide, you will learn:
In order for this to work, you need to have:
It's helpful to have some basic knowledge of:
Enable Python monitoring for your OneAgent as described in Python. This is required for OneAgent to instrument your Python AI application.
Navigate to
Settings > Collect and capture > General monitoring settings > OneAgent features and filter by Python.
Each supported AI SDK has a dedicated OneAgent feature that must be enabled to activate monitoring for that provider.
Enable the feature that matches your AI SDK, plus any framework and optional features relevant to your application:
| Feature | Purpose | Required |
|---|---|---|
Python AWS SDK Client | Instruments botocore; gates all AWS SDK monitoring | Required |
Python AWS SDK GenAI Bedrock | Adds Bedrock-specific GenAI attributes (model, tokens, …) | Required |
Python AWS SDK Bedrock prompt capture | Captures prompt text and model responses | Optional |
Python GenAI Langchain | Adds LangChain chain/node spans alongside Bedrock spans | Optional |
If your application serves HTTP requests, also enable the OneAgent feature for your web framework (for example, Python FastAPI, Python Django, or Python Flask) to create HTTP entry-point spans that the AI provider spans can nest under.
Sensors for additional providers are available as experimental sensors. These include, for example, Anthropic, Cohere, Groq, Mistral AI, Ollama, Google GenAI, CrewAI, and Haystack.
Experimental sensors are functional but delivered on an accelerated schedule to extend GenAI observability to additional AI providers.
They are not covered by Dynatrace support SLAs, and attribute collection is best-effort; completeness and schema may change in future releases without prior notice.
To enable an experimental sensor, search for the name of your AI provider or SDK in
Settings > Collect and capture > General monitoring settings > OneAgent features and enable the corresponding feature flag.
Prompt capture is currently supported for AWS Bedrock and OpenAI, including when those providers are used as the underlying model with LangChain.
Enable the corresponding optional prompt capture feature to view prompt content in
AI Observability > Explorer.
After enabling the OneAgent features, restart the Python application so the new features are picked up at process start.
Start your application and verify that OneAgent is monitoring the process.
You can confirm this by checking that the process is visible in
Infrastructure & Operations > Explorer > Compute > Processes in the Dynatrace UI.
Send a test request to your application:
curl -X POST http://<your-service>/generate \-H 'Content-Type: application/json' \-d '{"prompt":"What is observability?"}'
Expected response:
{"result": "..."}
Navigate to
AI Observability > Explorer.
The application appears as an AI service once the first instrumented request completes.
LLM request count and token usage are aggregated and visible at the service level.
Select the service to open the detail view. The Prompts chart shows latency data for captured LLM requests.
To inspect the full distributed trace for an individual request, navigate to Distributed Tracing.
The HTTP entry-point span (from the web framework sensor) contains the AI provider call as a child span carrying all GenAI-specific attributes:
gen_ai.provider: The name of the AI provider (for example, aws_bedrock or openai).gen_ai.model: The model used for the request.gen_ai.usage.input_tokens / gen_ai.usage.output_tokens: Token counts for the request.Now that you've set up OneAgent to automatically observe your AI application, you can:
AI Observability