VOOZH about

URL: https://docs.datadoghq.com/llm_observability/instrumentation/auto_instrumentation/

⇱ Automatic Instrumentation for Agent Observability


For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/llm_observability/instrumentation/auto_instrumentation.md. A documentation index is available at /llms.txt.
This product is not supported for your selected Datadog site. ().

Overview

Agent Observability can automatically trace and annotate calls to supported LLM frameworks and libraries through various LLM integrations. When you run your LLM application with the Agent Observability SDK, these LLM integrations are enabled by default and provide out-of-the-box traces and observability, without you having to change your code.

Automatic instrumentation works for calls to supported frameworks and libraries. To trace other calls (for example: API calls, database queries, internal functions), see the Agent Observability SDK reference for how to add manual instrumentation.

Supported frameworks and libraries

FrameworkSupported VersionsTracer Version
Amazon Bedrock>= 1.31.57>= 2.9.0
Amazon Bedrock Agents>= 1.38.26>= 3.10.0
Anthropic>= 0.28.0>= 2.10.0
Claude Agent SDK>= 0.0.23>= 4.5.0
CrewAI>= 0.105.0>= 3.5.0
Google ADK>= 1.0.0>= 3.15.0
Google GenAI>= 1.21.1>= 3.11.0
LangChain>= 0.1.0>= 2.9.0
LangGraph>= 0.2.23>= 3.10.1
LiteLLM>= 1.65.4>= 3.9.0
MCP>= 1.10.0>= 3.11.0
OpenAI, Azure OpenAI>= 1.0.0>= 2.9.0
OpenAI Agents>= 0.0.2>= 3.5.0
Pydantic AI>= 0.3.0>= 3.11.0
Strands Agents>= 1.11.0Any
Vertex AI>= 1.71.1>= 2.18.0
vLLM>= 0.10.2>= 4.2.0
FrameworkSupported VersionsTracer Version
Amazon Bedrock>= 3.422.0>= 5.35.0 (CJS), >=5.35.0 (ESM)
Anthropic>= 0.14.0>= 5.71.0 (CJS), >=5.71.0 (ESM)
LangChain>= 0.1.0>= 5.32.0 (CJS), >=5.38.0 (ESM)
MCP>= 1.27.1>= 5.99.0 (CJS), >=5.99.0 (ESM)
OpenAI, Azure OpenAI>= 3.0.0>= 4.49.0, >= 5.25.0 (CJS), >= 5.38.0 (ESM)
Vercel AI SDK>=4.0.0>= 5.63.0 (CJS), >=5.63.0 (ESM)
VertexAI>= 1.0.0>= 5.44.0 (CJS), >=5.44.0 (ESM)
Google GenAI>= 1.19.0>= 5.81.0 (CJS), >=5.81.0 (ESM)
FrameworkSupported VersionsTracer Version
OpenAI, Azure OpenAI>= 3.0.0>= 1.59.0
Agent Observability also supports any framework that natively emits OpenTelemetry GenAI semantic convention v1.37+-compliant spans, without requiring the Datadog SDK. See OpenTelemetry Instrumentation for setup details and tested frameworks.

LLM integrations

Datadog’s LLM integrations capture latency, errors, input parameters, input and output messages, and token usage (when available) for traced calls.

Enable or disable LLM integrations

All integrations are enabled by default.

Disable all LLM integrations

Use the in-code SDK setup and specify integrations_enabled=False.

Example: In-code SDK setup that disables all LLM integrations

from ddtrace.llmobs import LLMObs
LLMObs.enable(
 ml_app="<YOUR_ML_APP_NAME>",
 api_key="<YOUR_DATADOG_API_KEY>",
 integrations_enabled=False
)

Use the in-code SDK setup and specify plugins: false.

Example: In-code SDK setup that disables all LLM integrations

const tracer = require('dd-trace').init({
 llmobs: { ... },
 plugins: false
});
const { llmobs } = tracer;

Only enable specific LLM integrations

  1. Use the in-code SDK setup and disable all integrations with integrations_enabled=False.
  2. Manually enable select integrations with ddtrace.patch().

Example: In-code SDK setup that only enables the LangChain integration

from ddtrace import patch
from ddtrace.llmobs import LLMObs
LLMObs.enable(
 ml_app="<YOUR_ML_APP_NAME>",
 api_key="<YOUR_DATADOG_API_KEY>",
 integrations_enabled=False
)
patch(langchain=True)
  1. Use the in-code SDK setup and disable all integrations with plugins: false.
  2. Manually enable select integrations with use().

Example: In-code SDK setup that only enables the LangChain integration

const tracer = require('dd-trace').init({
 llmobs: { ... },
 plugins: false
});
const { llmobs } = tracer;
tracer.use('langchain', true);

For more specific control over library patching and the integration that starts the span, you can set the following environment variables:

DD_PATCH_MODULES
A comma-separated list of modules to enable or disable patching for. Overrides the default patching behavior. Use the format module:true,module:false. Available in version 2.17.4+.
Example: DD_PATCH_MODULES=openai:false,langchain:false
DD_TRACE_DISABLED_INSTRUMENTATIONS
A comma-separated string of library names that are not patched when the tracer is initialized.
Example: DD_TRACE_DISABLED_INSTRUMENTATIONS=openai,http

Further Reading