and toolkitsMemoryCallbacksChat loadersProvidersMoreDatadog TracingOn this pageDatadog Tracingddtrace is a Datadog application performance monitoring (APM) library which provides an integration to monitor your LangChain application.Key features of the ddtrace integration for LangChain:Traces: Capture LangChain requests, parameters, prompt-completions, and help visualize LangChain operations.Metrics: Capture LangChain request latency, errors, and token/cost usage (for OpenAI LLMs and chat models).Logs: Store prompt completion data for each LangChain operation.Dashboard: Combine metrics, logs, and trace data into a single plane to monitor LangChain requests.Monitors: Provide alerts in response to spikes in LangChain request latency or error rate.Note: The ddtrace LangChain integration currently provides tracing for LLMs, chat models, Text Embedding Models, Chains, and Vectorstores.Installation and Setup‚ÄãEnable APM and StatsD in your Datadog Agent, along with a Datadog API key. For example, in Docker:docker run -d --cgroupns host \              --pid host \              -v /var/run/docker.sock:/var/run/docker.sock:ro \              -v /proc/:/host/proc/:ro \              -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro \              -e DD_API_KEY=<DATADOG_API_KEY> \              -p 127.0.0.1:8126:8126/tcp \              -p 127.0.0.1:8125:8125/udp \              -e DD_DOGSTATSD_NON_LOCAL_TRAFFIC=true \              -e DD_APM_ENABLED=true \              gcr.io/datadoghq/agent:latestInstall the Datadog APM Python library.pip install ddtrace>=1.17The LangChain integration can be enabled automatically when you prefix your LangChain Python application command with ddtrace-run:DD_SERVICE="my-service" DD_ENV="staging" DD_API_KEY=<DATADOG_API_KEY> ddtrace-run python <your-app>.pyNote: If the Agent is using a non-default hostname or port, be sure to also set DD_AGENT_HOST, DD_TRACE_AGENT_PORT, or DD_DOGSTATSD_PORT.Additionally, the LangChain integration can be enabled
ddtrace is a Datadog application performance monitoring (APM) library which provides an integration to monitor your LangChain application.
ddtrace is a Datadog application performance monitoring (APM) library which provides an integration to monitor your LangChain application. ->: and toolkitsMemoryCallbacksChat loadersProvidersMoreDatadog TracingOn this pageDatadog Tracingddtrace is a Datadog application performance monitoring (APM) library which provides an integration to monitor your LangChain application.Key features of the ddtrace integration for LangChain:Traces: Capture LangChain requests, parameters, prompt-completions, and help visualize LangChain operations.Metrics: Capture LangChain request latency, errors, and token/cost usage (for OpenAI LLMs and chat models).Logs: Store prompt completion data for each LangChain operation.Dashboard: Combine metrics, logs, and trace data into a single plane to monitor LangChain requests.Monitors: Provide alerts in response to spikes in LangChain request latency or error rate.Note: The ddtrace LangChain integration currently provides tracing for LLMs, chat models, Text Embedding Models, Chains, and Vectorstores.Installation and Setup‚ÄãEnable APM and StatsD in your Datadog Agent, along with a Datadog API key. For example, in Docker:docker run -d --cgroupns host \              --pid host \              -v /var/run/docker.sock:/var/run/docker.sock:ro \              -v /proc/:/host/proc/:ro \              -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro \              -e DD_API_KEY=<DATADOG_API_KEY> \              -p 127.0.0.1:8126:8126/tcp \              -p 127.0.0.1:8125:8125/udp \              -e DD_DOGSTATSD_NON_LOCAL_TRAFFIC=true \              -e DD_APM_ENABLED=true \              gcr.io/datadoghq/agent:latestInstall the Datadog APM Python library.pip install ddtrace>=1.17The LangChain integration can be enabled automatically when you prefix your LangChain Python application command with ddtrace-run:DD_SERVICE="my-service" DD_ENV="staging" DD_API_KEY=<DATADOG_API_KEY> ddtrace-run python <your-app>.pyNote: If the Agent is using a non-default hostname or port, be sure to also set DD_AGENT_HOST, DD_TRACE_AGENT_PORT, or DD_DOGSTATSD_PORT.Additionally, the LangChain integration can be enabled