@@ -8,193 +8,11 @@ Sentry AI Agent Monitoring helps you track and debug AI agent applications using
88
99To start sending AI agent data to Sentry, make sure you've created a Sentry project for your AI-enabled repository and follow one of the guides below:
1010
11- ## Supported SDKs
11+ - [ Python] ( /platforms/python/tracing/instrumentation/custom-instrumentation/ai-agents-module )
12+ - [ Node.js] ( /platforms/javascript/guides/node/tracing/instrumentation/ai-agents-module/ )
1213
13- ### JavaScript - Vercel AI SDK
1414
15- The Sentry JavaScript SDK supports AI agent monitoring through the Vercel AI integration, which works with Node.js and Bun runtimes. This integration automatically captures spans for your AI agent workflows using the AI SDK's built-in telemetry.
16-
17- #### Supported Platforms
18-
19- - <LinkWithPlatformIcon
20- platform = " javascript.node"
21- label = " Node.js"
22- url = " /platforms/javascript/guides/node/configuration/integrations/vercelai/"
23- />
24- - <LinkWithPlatformIcon
25- platform = " javascript.nextjs"
26- label = " Next.js"
27- url = " /platforms/javascript/guides/nextjs/configuration/integrations/vercelai/"
28- />
29- - <LinkWithPlatformIcon
30- platform = " javascript.sveltekit"
31- label = " SvelteKit"
32- url = " /platforms/javascript/guides/sveltekit/configuration/integrations/vercelai/"
33- />
34- - <LinkWithPlatformIcon
35- platform = " javascript.nuxt"
36- label = " Nuxt"
37- url = " /platforms/javascript/guides/nuxt/configuration/integrations/vercelai/"
38- />
39- - <LinkWithPlatformIcon
40- platform = " javascript.astro"
41- label = " Astro"
42- url = " /platforms/javascript/guides/astro/configuration/integrations/vercelai/"
43- />
44- - <LinkWithPlatformIcon
45- platform = " javascript.remix"
46- label = " Remix"
47- url = " /platforms/javascript/guides/remix/configuration/integrations/vercelai/"
48- />
49- - <LinkWithPlatformIcon
50- platform = " javascript.solidstart"
51- label = " SolidStart"
52- url = " /platforms/javascript/guides/solidstart/configuration/integrations/vercelai/"
53- />
54- - <LinkWithPlatformIcon
55- platform = " javascript.express"
56- label = " Express"
57- url = " /platforms/javascript/guides/express/configuration/integrations/vercelai/"
58- />
59- - <LinkWithPlatformIcon
60- platform = " javascript.fastify"
61- label = " Fastify"
62- url = " /platforms/javascript/guides/fastify/configuration/integrations/vercelai/"
63- />
64- - <LinkWithPlatformIcon
65- platform = " javascript.nestjs"
66- label = " Nest.js"
67- url = " /platforms/javascript/guides/nestjs/configuration/integrations/vercelai/"
68- />
69- - <LinkWithPlatformIcon
70- platform = " javascript.hapi"
71- label = " Hapi"
72- url = " /platforms/javascript/guides/hapi/configuration/integrations/vercelai/"
73- />
74- - <LinkWithPlatformIcon
75- platform = " javascript.koa"
76- label = " Koa"
77- url = " /platforms/javascript/guides/koa/configuration/integrations/vercelai/"
78- />
79- - <LinkWithPlatformIcon
80- platform = " javascript.connect"
81- label = " Connect"
82- url = " /platforms/javascript/guides/connect/configuration/integrations/vercelai/"
83- />
84- - <LinkWithPlatformIcon
85- platform = " javascript.cloudflare"
86- label = " Cloudflare"
87- url = " /platforms/javascript/guides/cloudflare/configuration/integrations/vercelai/"
88- />
89- - <LinkWithPlatformIcon
90- platform = " javascript.hono"
91- label = " Hono"
92- url = " /platforms/javascript/guides/hono/configuration/integrations/vercelai/"
93- />
94- - <LinkWithPlatformIcon
95- platform = " javascript.bun"
96- label = " Bun"
97- url = " /platforms/javascript/guides/bun/configuration/integrations/vercelai/"
98- />
99- - <LinkWithPlatformIcon
100- platform = " javascript.aws-lambda"
101- label = " AWS Lambda"
102- url = " /platforms/javascript/guides/aws-lambda/configuration/integrations/vercelai/"
103- />
104- - <LinkWithPlatformIcon
105- platform = " javascript.azure-functions"
106- label = " Azure Functions"
107- url = " /platforms/javascript/guides/azure-functions/configuration/integrations/vercelai/"
108- />
109- - <LinkWithPlatformIcon
110- platform = " javascript.gcp-functions"
111- label = " Google Cloud Functions"
112- url = " /platforms/javascript/guides/gcp-functions/configuration/integrations/vercelai/"
113- />
114- - <LinkWithPlatformIcon
115- platform = " javascript.electron"
116- label = " Electron"
117- url = " /platforms/javascript/guides/electron/configuration/integrations/vercelai/"
118- />
119-
120- #### Quick Start with Vercel AI SDK
121-
122- ``` javascript
123- import * as Sentry from " @sentry/node" ;
124-
125- // Sentry init needs to be above everything else
126- Sentry .init ({
127- tracesSampleRate: 1.0 ,
128- integrations: [Sentry .vercelAIIntegration ()],
129- });
130-
131- import { generateText } from " ai" ;
132- import { openai } from " @ai-sdk/openai" ;
133-
134- // Your AI agent function
135- async function aiAgent (userQuery ) {
136- const result = await generateText ({
137- model: openai (" gpt-4o" ),
138- prompt: userQuery,
139- experimental_telemetry: {
140- isEnabled: true ,
141- functionId: " ai-agent-main" ,
142- recordInputs: true ,
143- recordOutputs: true ,
144- },
145- });
146-
147- return result .text ;
148- }
149- ```
150-
151- <Alert title = " Don't see your SDK?" >
152-
153- We'll be adding AI agent integrations continuously. Please vote on [ GitHub] ( https://github.com/getsentry/sentry-javascript/issues/16960 ) which one you'd like to see next. You can also instrument AI agents manually by following our [ manual instrumentation guide] ( /platforms/javascript/guides/node/tracing/instrumentation/ai-agents-module ) .
154-
155- </Alert >
156-
157- ### Python - OpenAI Agents
158-
159- The Sentry Python SDK supports OpenAI Agents SDK.
160-
161- #### Supported Platforms
162-
163- - <LinkWithPlatformIcon
164- platform = " python"
165- label = " Python"
166- url = " /platforms/python/integrations/openai-agents/"
167- />
168-
169- #### Quick Start with OpenAI Agents
170-
171- ``` python
172- import sentry_sdk
173- import agents
174- from pydantic import BaseModel
175-
176- sentry_sdk.init(
177- dsn = " YOUR_DSN" ,
178- traces_sample_rate = 1.0 ,
179- send_default_pii = True , # Include LLM inputs/outputs
180- )
181-
182- # Create your AI agent
183- my_agent = agents.Agent(
184- name = " My Agent" ,
185- instructions = " You are a helpful assistant." ,
186- model = " gpt-4o-mini" ,
187- )
188-
189- # Your AI agent function
190- result = await agents.Runner.run(
191- my_agent,
192- input = user_query,
193- )
194-
195- ```
196-
197- <Alert title = " Don't see your SDK?" >
15+ <Alert title = " Don't see your runtime?" >
19816
19917You can also instrument AI agents manually by following our [ manual instrumentation guides] ( /platforms/python/tracing/instrumentation/custom-instrumentation/ai-agents-module ) .
20018
0 commit comments