-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Add Datadog Integration Documentation #3642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
tonykipkemboi
merged 18 commits into
crewAIInc:main
from
sabrenner:sabrenner/datadog-integration
Oct 27, 2025
+318
−0
Merged
Changes from 5 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
1e65afa
add datadog llm observability integration guide
sabrenner 57cc464
spacing fix
sabrenner c54358f
wording changes
sabrenner 40eb5b0
alphabetize docs listing
sabrenner 2b5de45
Merge branch 'main' of github.com:sabrenner/crewAI into sabrenner/dat…
sabrenner c1bd9db
Update docs/en/observability/datadog.mdx
sabrenner ad04b1e
Merge branch 'main' into sabrenner/datadog-integration
greysonlalonde f23e1e6
Merge branch 'main' into sabrenner/datadog-integration
greysonlalonde d0af6b8
add translations
sabrenner 5e2421f
Merge branch 'sabrenner/datadog-integration' of github.com:sabrenner/…
sabrenner 0a73f19
fix korean code block
sabrenner 3e18b2d
Merge branch 'main' into sabrenner/datadog-integration
greysonlalonde 496ca9c
Merge branch 'main' into sabrenner/datadog-integration
sabrenner c9f9f77
Merge branch 'main' into sabrenner/datadog-integration
sabrenner b13dfad
Merge branch 'main' into sabrenner/datadog-integration
sabrenner 4d0ac5a
Merge branch 'main' into sabrenner/datadog-integration
sabrenner 7a94683
Merge branch 'main' into sabrenner/datadog-integration
sabrenner f1a5aa2
Merge branch 'main' into sabrenner/datadog-integration
sabrenner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| --- | ||
| title: Datadog Integration | ||
| description: Learn how to integrate Datadog with CrewAI to submit LLM Observability traces to Datadog. | ||
| icon: dog | ||
| mode: "wide" | ||
| --- | ||
|
|
||
| # Integrate Datadog with CrewAI | ||
|
|
||
| This guide will demonstrate how to integrate **Datadog** with **CrewAI** using Datadog auto-instrumentation. By the end of this guide, you will be able to submit LLM Observability traces to Datadog and view your CrewAI agent runs in Datadog LLM Observability's Agentic Execution View. | ||
sabrenner marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## What is Datadog LLM Observability? | ||
|
|
||
| [Datadog LLM Observability](https://www.datadoghq.com/product/llm-observability/) helps AI engineers, data scientists, and application developers quickly develop, evaluate, and monitor LLM applications. Confidently improve output quality, performance, costs, and overall risk with structured experiments, end-to-end tracing across AI agents, and evaluations. | ||
|
|
||
| ## Getting Started | ||
|
|
||
| ### Install Dependencies | ||
|
|
||
| ```shell | ||
| pip install ddtrace crewai crewai-tools | ||
| ``` | ||
|
|
||
| ### Set Environment Variables | ||
|
|
||
| If you do not have a Datadog API key, you can [create an account](https://www.datadoghq.com/) and [get your API key](https://docs.datadoghq.com/account_management/api-app-keys/#api-keys). | ||
|
|
||
| You will also need to specify an ML Application name in the following environment variables. An ML Application is a grouping of LLM Observability traces associated with a specific LLM-based application. See [ML Application Naming Guidelines](https://docs.datadoghq.com/llm_observability/instrumentation/sdk?tab=python#application-naming-guidelines) for more information on limitations with ML Application names. | ||
|
|
||
| ```shell | ||
| export DD_API_KEY=<YOUR_DD_API_KEY> | ||
| export DD_SITE=<YOUR_DD_SITE> | ||
| export DD_LLMOBS_ENABLED=true | ||
| export DD_LLMOBS_ML_APP=<YOUR_ML_APP_NAME> | ||
| export DD_LLMOBS_AGENTLESS_ENABLED=true | ||
| export DD_APM_TRACING_ENABLED=false | ||
| ``` | ||
|
|
||
| Additionally, configure any LLM provider API keys | ||
|
|
||
| ```shell | ||
| export OPENAI_API_KEY=<YOUR_OPENAI_API_KEY> | ||
| export ANTHROPIC_API_KEY=<YOUR_ANTHROPIC_API_KEY> | ||
| export GEMINI_API_KEY=<YOUR_GEMINI_API_KEY> | ||
| ... | ||
| ``` | ||
|
|
||
| ### Create a CrewAI Agent Application | ||
|
|
||
| ```python | ||
| # crewai_agent.py | ||
| from crewai import Agent, Task, Crew | ||
|
|
||
| from crewai_tools import ( | ||
| WebsiteSearchTool | ||
| ) | ||
|
|
||
| web_rag_tool = WebsiteSearchTool() | ||
|
|
||
| writer = Agent( | ||
| role="Writer", | ||
| goal="You make math engaging and understandable for young children through poetry", | ||
| backstory="You're an expert in writing haikus but you know nothing of math.", | ||
| tools=[web_rag_tool], | ||
| ) | ||
|
|
||
| task = Task( | ||
| description=("What is {multiplication}?"), | ||
| expected_output=("Compose a haiku that includes the answer."), | ||
| agent=writer | ||
| ) | ||
|
|
||
| crew = Crew( | ||
| agents=[writer], | ||
| tasks=[task], | ||
| share_crew=False | ||
| ) | ||
|
|
||
| output = crew.kickoff(dict(multiplication="2 * 2")) | ||
| ``` | ||
|
|
||
| ### Run the Application with Datadog Auto-Instrumentation | ||
|
|
||
| With the [environment variables](#set-environment-variables) set, you can now run the application with Datadog auto-instrumentation. | ||
|
|
||
| ```shell | ||
| ddtrace-run python crewai_agent.py | ||
| ``` | ||
|
|
||
| ### View the Traces in Datadog | ||
|
|
||
| After running the application, you can view the traces in [Datadog LLM Observability's Traces View](https://app.datadoghq.com/llm/traces), selecting the ML Application name you chose from the top-left dropdown. | ||
|
|
||
| Clicking on a trace will show you the details of the trace, including total tokens used, number of LLM calls, models used, and estimated cost. Clicking into a specific span will narrow down these details, and show related input, output, and metadata. | ||
|
|
||
|  | ||
|
|
||
| Additionally, you can view the execution graph view of the trace, which shows the control and data flow of the trace, which will scale with larger agents to show handoffs and relationships between LLM calls, tool calls, and agent interactions. | ||
|
|
||
|  | ||
|
|
||
| ## References | ||
|
|
||
| - [Datadog LLM Observability](https://www.datadoghq.com/product/llm-observability/) | ||
| - [Datadog LLM Observability CrewAI Auto-Instrumentation](https://docs.datadoghq.com/llm_observability/instrumentation/auto_instrumentation?tab=python#crew-ai) | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.