You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add Node.js MCP client auto-instrumentation docs
Document the dd-trace-js MCP client integration (@modelcontextprotocol/sdk,
shipped in dd-trace 5.99.0):
- Add a Node.js tab to the MCP auto-instrumentation section in mcp_client.md
- Add MCP to the Node.js supported frameworks table in auto_instrumentation.md
- Add a Node.js tab to the MCP integration reference (package and integration
names, traced client methods)
Covers client-side tracing only; server-side support is not yet available.
* Chores: fix whitespace
* Update Node MCP link in auto_instrumentation.md
* Fix Node.js MCP run command and link to SDK setup guide
- Correct the Node.js run command to invoke node explicitly
(NODE_OPTIONS="--import dd-trace/initialize.mjs" node <YOUR_APP_ENTRYPOINT>)
in both the auto-instrumentation and manual sections, for parity with the
existing Agent Observability instrumentation guides
- Add a link to the Agent Observability SDK setup guide at the end of each
auto-instrumentation tab for additional configuration options
* chore: use reference-style links for MCP setup guide
Match the reference-link convention used elsewhere in the docs by defining the
setup guide links per-tab instead of inline.
---------
Co-authored-by: Janine Chan <janine.chan@datadoghq.com>
The [Amazon Bedrock integration][1] provides automatic instrumentation for the Amazon Bedrock Runtime Python SDK's chat model calls (using [Boto3][2]/[Botocore][3]).
131
132
132
-
**Package name:**`boto3`
133
+
**Package name:**`boto3`\
133
134
**Integration name:**`botocore`
134
135
135
136
### Traced methods
@@ -159,7 +160,7 @@ The Amazon Bedrock integration instruments the following methods:
159
160
{{% tab "Node.js" %}}
160
161
The [Amazon Bedrock integration][1] provides automatic tracing for the Amazon Bedrock Runtime Node.js SDK's chat model calls (using [BedrockRuntimeClient][2]).
@@ -183,7 +184,7 @@ The Amazon Bedrock integration instruments the following methods:
183
184
{{% tab "Python" %}}
184
185
The Amazon Bedrock Agents integration provides automatic tracing for the Amazon Bedrock Agents Runtime Python SDK's agent invoke calls (using [Boto3][1]/[Botocore][2]).
185
186
186
-
**Package name:**`boto3`
187
+
**Package name:**`boto3`\
187
188
**Integration name:**`botocore`
188
189
189
190
### Traced methods
@@ -208,7 +209,7 @@ tracing intra-agent steps, you must set <code>enableTrace=True</code> in the <co
208
209
{{% tab "Python" %}}
209
210
The [Anthropic integration][1] provides automatic tracing for the [Anthropic Python SDK's][2] chat message calls.
210
211
211
-
**Package name:**`anthropic`
212
+
**Package name:**`anthropic`\
212
213
**Integration name:**`anthropic`
213
214
214
215
### Traced methods
@@ -229,7 +230,7 @@ The Anthropic integration instruments the following methods:
229
230
{{% tab "Node.js" %}}
230
231
The [Anthropic integration][1] provides automatic tracing for the [Anthropic Node.js SDK's][2] chat message calls.
231
232
232
-
**Package name:**`@anthropic-ai/sdk`
233
+
**Package name:**`@anthropic-ai/sdk`\
233
234
**Integration name:**`anthropic`
234
235
235
236
### Traced methods
@@ -254,7 +255,7 @@ The Anthropic integration instruments the following methods:
254
255
{{% tab "Python" %}}
255
256
The Claude Agent SDK integration provides automatic tracing for agent queries made through the [Claude Agent SDK for Python][1].
256
257
257
-
**Package name:**`claude-agent-sdk`
258
+
**Package name:**`claude-agent-sdk`\
258
259
**Integration name:**`claude_agent_sdk`
259
260
260
261
### Traced methods
@@ -278,7 +279,7 @@ The Claude Agent SDK integration instruments the following methods:
278
279
{{% tab "Python" %}}
279
280
The [CrewAI integration][1] automatically traces execution of Crew kickoffs, including task/agent/tool invocations, made through [CrewAI's Python SDK][2].
280
281
281
-
**Package name:**`crewai`
282
+
**Package name:**`crewai`\
282
283
**Integration name:**`crewai`
283
284
284
285
### Traced methods
@@ -316,7 +317,7 @@ The CrewAI integration instruments the following methods:
316
317
{{% tab "Python" %}}
317
318
The Google ADK integration provides automatic tracing for agent runs, tool calls, and code executions made through [Google's ADK Python SDK][1].
318
319
319
-
**Package name:**`google-adk`
320
+
**Package name:**`google-adk`\
320
321
**Integration name:**`google_adk`
321
322
322
323
### Traced methods
@@ -342,7 +343,7 @@ Both `run_live` and `run_async` methods are supported.
342
343
{{% tab "Python" %}}
343
344
The Google GenAI integration automatically traces methods in the [Google GenAI Python SDK][1].
344
345
345
-
**Package name:**`google-genai`
346
+
**Package name:**`google-genai`\
346
347
**Integration name:**`google_genai`
347
348
348
349
**Note:** The [Google GenAI Python SDK][1] succeeds the Google GenerativeAI SDK, and exposes both Gemini Developer API as well as Vertex.
@@ -367,7 +368,7 @@ The Google GenAI integration automatically traces methods in the [Google GenAI N
367
368
368
369
**Note:** The [Google GenAI Node.js SDK][1] succeeds the [Google GenerativeAI SDK][6], and exposes both Gemini Developer API as well as Vertex.
369
370
370
-
**Package name:**`@google/genai`
371
+
**Package name:**`@google/genai`\
371
372
**Integration name:**`google-genai`
372
373
373
374
### Traced methods
@@ -392,7 +393,7 @@ The Google GenAI integration instruments the following methods:
392
393
{{% tab "Python" %}}
393
394
The [LangChain integration][1] provides automatic tracing for the [LangChain Python SDK's][2] LLM, chat model, and chain calls.
394
395
395
-
**Package name:**`langchain`, `langchain_openai`, `langchain_anthropic`, and [other langchain partner packages][10]
396
+
**Package name:**`langchain`, `langchain_openai`, `langchain_anthropic`, and [other langchain partner packages][10]\
396
397
**Integration name:**`langchain`
397
398
398
399
### Traced methods
@@ -441,7 +442,7 @@ The LangChain integration instruments the following methods:
441
442
{{% tab "Node.js" %}}
442
443
The [LangChain integration][1] provides automatic tracing for the [LangChain Node.js SDK's][2] LLM, chat model, chain, and OpenAI embeddings calls.
443
444
444
-
**Package name:**`langchain`, `@langchain/openai`, `@langchain/anthropic`, and [other langchain partner packages][7]
445
+
**Package name:**`langchain`, `@langchain/openai`, `@langchain/anthropic`, and [other langchain partner packages][7]\
445
446
**Integration name:**`langchain`
446
447
447
448
### Traced methods
@@ -475,7 +476,7 @@ The LangChain integration instruments the following methods:
475
476
{{% tab "Python" %}}
476
477
The LangGraph integration automatically traces `Pregel/CompiledGraph` and `RunnableSeq (node)` invocations made through the [LangGraph Python SDK][1].
477
478
478
-
**Package name:**`langgraph`
479
+
**Package name:**`langgraph`\
479
480
**Integration name:**`langgraph`
480
481
481
482
### Traced methods
@@ -497,7 +498,7 @@ The LangGraph integration instruments synchronous and asynchronous versions of t
497
498
{{% tab "Python" %}}
498
499
The [LiteLLM integration][1] provides automatic tracing for the [LiteLLM Python SDK][2] and [proxy server router methods][3].
499
500
500
-
**Package name:**`litellm`
501
+
**Package name:**`litellm`\
501
502
**Integration name:**`litellm`
502
503
503
504
### Traced methods
@@ -531,7 +532,7 @@ The LiteLLM integration instruments the following methods:
531
532
{{% tab "Python" %}}
532
533
The Model Context Protocol (MCP) integration instruments client and server tool calls in the [MCP][1] SDK.
533
534
534
-
**Package name:**`mcp`
535
+
**Package name:**`mcp`\
535
536
**Integration name:**`mcp`
536
537
537
538
### Traced methods
@@ -548,6 +549,24 @@ The MCP integration instruments the following methods:
@@ -556,7 +575,7 @@ The MCP integration instruments the following methods:
556
575
{{% tab "Python" %}}
557
576
The [OpenAI integration][1] provides automatic tracing for the [OpenAI Python SDK's][2] completion and chat completion endpoints to OpenAI and Azure OpenAI.
558
577
559
-
**Package name:**`openai`
578
+
**Package name:**`openai`\
560
579
**Integration name:**`openai`
561
580
562
581
### Traced methods
@@ -588,7 +607,7 @@ The OpenAI integration instruments the following methods, including streamed cal
588
607
{{% tab "Node.js" %}}
589
608
The [OpenAI integration][1] provides automatic tracing for the [OpenAI Node.js SDK's][2] completion, chat completion, and embeddings endpoints to OpenAI and [Azure OpenAI][3].
590
609
591
-
**Package name:**`openai`
610
+
**Package name:**`openai`\
592
611
**Integration name:**`openai`
593
612
594
613
### Traced methods
@@ -661,7 +680,7 @@ The provider (OpenAI vs Azure OpenAI) is automatically detected based on the `ba
661
680
The OpenAI Agents integration converts the [built-in tracing][1] from the [OpenAI Agents SDK][2] into
662
681
Agent Observability format and sends it to Agent Observability product by adding a Datadog trace processor.
663
682
664
-
**Package name:**`openai-agents`
683
+
**Package name:**`openai-agents`\
665
684
**Integration name:**`openai_agents`
666
685
667
686
The following operations are supported:
@@ -693,7 +712,7 @@ The following operations are supported:
693
712
{{% tab "Python" %}}
694
713
The Pydantic AI integration instruments agent invocations and tool calls made using the [Pydantic AI][1] agent framework.
695
714
696
-
**Package name:**`pydantic-ai`
715
+
**Package name:**`pydantic-ai`\
697
716
**Integration name:**`pydantic_ai`
698
717
699
718
### Traced methods
@@ -730,7 +749,7 @@ For setup instructions and a complete example, see [OpenTelemetry Instrumentatio
730
749
{{% tab "Node.js" %}}
731
750
The [Vercel AI SDK][1] integration automatically traces text and object generation, embeddings, and tool calls by intercepting the OpenTelemetry spans created by the underlying core [Vercel AI SDK][2] and converting them into Agent Observability spans.
732
751
733
-
**Package name:**`ai`
752
+
**Package name:**`ai`\
734
753
**Integration name:**`ai`
735
754
736
755
### Traced methods
@@ -795,7 +814,7 @@ async function main () {
795
814
{{% tab "Python" %}}
796
815
The [Vertex AI integration][1] automatically traces content generation and chat message calls made through [Google's Vertex AI Python SDK][2].
797
816
798
-
**Package name:**`vertexai`
817
+
**Package name:**`vertexai`\
799
818
**Integration name:**`vertexai`
800
819
801
820
### Traced methods
@@ -819,7 +838,7 @@ The Vertex AI integration instruments the following methods:
819
838
{{% tab "Node.js" %}}
820
839
The [Vertex AI integration][1] automatically traces content generation and chat message calls made through [Google's Vertex AI Node.js SDK][2].
821
840
822
-
**Package name:**`@google-cloud/vertexai`
841
+
**Package name:**`@google-cloud/vertexai`\
823
842
**Integration name:**`google-cloud-vertexai`
824
843
825
844
### Traced methods
@@ -846,7 +865,7 @@ The Vertex AI integration instruments the following methods:
846
865
{{% tab "Python" %}}
847
866
The vLLM integration automatically traces request processing and token generation in the [vLLM][1] inference engine. It captures model name, input and output tokens, and latency metrics (time to first token, queue time, prefill time, decode time, and inference time).
Copy file name to clipboardExpand all lines: content/en/llm_observability/monitoring/mcp_client.md
+51-10Lines changed: 51 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,18 +11,21 @@ further_reading:
11
11
12
12
You can monitor your MCP clients with Agent Observability in two ways:
13
13
14
-
-[Automatic instrumentation](#automatically-instrument-your-mcp-client): If you are using the official [MCP Python SDK][1]
15
-
-[Manual instrumentation](#manually-instrument-your-mcp-client): If you are not using the official MCP Python SDK, or your MCP clients are written in Node.js or Java
14
+
-[Automatic instrumentation](#automatically-instrument-your-mcp-client): If you are using the official [MCP Python SDK][1] or [MCP JavaScript SDK][3]
15
+
-[Manual instrumentation](#manually-instrument-your-mcp-client): If you are not using an official MCP SDK, or your MCP clients are written in Java
16
16
17
17
## Automatically instrument your MCP client
18
18
19
+
{{< tabs >}}
20
+
21
+
{{% tab "Python" %}}
19
22
If you are using the official MCP Python SDK to connect to an MCP server with an MCP client session, use the following steps to automatically instrument your MCP client application:
20
23
21
24
1. Install `ddtrace`:
22
25
23
-
{{< code-block lang="shell">}}
24
-
pip install ddtrace
25
-
{{< /code-block >}}
26
+
```shell
27
+
pip install ddtrace
28
+
```
26
29
27
30
2. Set the required environment variables:
28
31
@@ -36,9 +39,46 @@ pip install ddtrace
36
39
37
40
3. Run your application with the `ddtrace-run` command:
38
41
39
-
{{< code-block lang="shell">}}
40
-
ddtrace-run <YOUR_APP_STARTUP_COMMAND>
41
-
{{< /code-block >}}
42
+
```shell
43
+
ddtrace-run <YOUR_APP_STARTUP_COMMAND>
44
+
```
45
+
46
+
For additional configuration options, see the [Agent Observability SDK setup guide][1].
If you are using the official MCP JavaScript SDK to connect to an MCP server with an MCP client session, use the following steps to automatically instrument your MCP client application:
0 commit comments