) => (
{t("Waiting for this project's first agent events")}
From a5ec19bddc98c0d25c8ea0146e872d6ea986dcce Mon Sep 17 00:00:00 2001
From: Ogi <86684834+obostjancic@users.noreply.github.com>
Date: Thu, 8 Jan 2026 16:09:11 +0100
Subject: [PATCH 2/8] remove export
---
.../views/insights/pages/agents/llmOnboardingInstructions.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/static/app/views/insights/pages/agents/llmOnboardingInstructions.tsx b/static/app/views/insights/pages/agents/llmOnboardingInstructions.tsx
index ede407870a7aac..654e59905004ae 100644
--- a/static/app/views/insights/pages/agents/llmOnboardingInstructions.tsx
+++ b/static/app/views/insights/pages/agents/llmOnboardingInstructions.tsx
@@ -21,7 +21,7 @@ export function CopyLLMPromptButton() {
);
}
-export const LLM_ONBOARDING_INSTRUCTIONS = `
+const LLM_ONBOARDING_INSTRUCTIONS = `
# Instrument Sentry AI Agent Monitoring
Follow this decision tree to instrument AI Agent Monitoring.
From 173fab173c13479b1e59ed01a33fdecf8e4d7d63 Mon Sep 17 00:00:00 2001
From: Ogi
Date: Fri, 9 Jan 2026 10:51:28 +0100
Subject: [PATCH 3/8] Update
static/app/views/insights/pages/agents/onboarding.tsx
Co-authored-by: Simon Hellmayr
---
static/app/views/insights/pages/agents/onboarding.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/static/app/views/insights/pages/agents/onboarding.tsx b/static/app/views/insights/pages/agents/onboarding.tsx
index bde0b26c895491..96c438b6d185da 100644
--- a/static/app/views/insights/pages/agents/onboarding.tsx
+++ b/static/app/views/insights/pages/agents/onboarding.tsx
@@ -386,7 +386,7 @@ function NoDocsOnboarding({project}: {project: Project}) {
'You can set up the Sentry SDK by following our [link:documentation], or use an AI coding agent to do it for you.',
{
link: (
-
+
),
}
)}
From 61fb9df714458a003024886b73ebefd68aebc0e6 Mon Sep 17 00:00:00 2001
From: Ogi
Date: Mon, 12 Jan 2026 13:17:25 +0100
Subject: [PATCH 4/8] Update
static/app/views/insights/pages/agents/llmOnboardingInstructions.tsx
Co-authored-by: Simon Hellmayr
---
.../views/insights/pages/agents/llmOnboardingInstructions.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/static/app/views/insights/pages/agents/llmOnboardingInstructions.tsx b/static/app/views/insights/pages/agents/llmOnboardingInstructions.tsx
index 654e59905004ae..6ca83ae1188468 100644
--- a/static/app/views/insights/pages/agents/llmOnboardingInstructions.tsx
+++ b/static/app/views/insights/pages/agents/llmOnboardingInstructions.tsx
@@ -55,7 +55,7 @@ Check in this order - **use the highest-level framework found** (e.g., if using
| Library (check in order) | JS Integration | Python Integration | Python Extra |
|--------------------------|---------------|-------------------|--------------|
| Vercel AI SDK | \`Sentry.vercelAIIntegration()\` | - | - |
-| LangGraph | \`Sentry.langChainIntegration()\` | Auto-enabled | \`sentry-sdk[langgraph]\` |
+| LangGraph | \`Sentry.langGraphIntegration()\` | Auto-enabled | \`sentry-sdk[langgraph]\` |
| LangChain | \`Sentry.langChainIntegration()\` | Auto-enabled | \`sentry-sdk[langchain]\` |
| OpenAI Agents | - | \`OpenAIAgentsIntegration()\` | - |
| Pydantic AI | - | \`PydanticAIIntegration()\` | \`sentry-sdk[pydantic_ai]\` |
From 6aa0a1b907b96ffd9a97c035de91c704ac7c6178 Mon Sep 17 00:00:00 2001
From: Ogi
Date: Tue, 13 Jan 2026 10:29:55 +0100
Subject: [PATCH 5/8] Update
static/app/views/insights/pages/agents/llmOnboardingInstructions.tsx
Co-authored-by: Simon Hellmayr
---
.../views/insights/pages/agents/llmOnboardingInstructions.tsx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/static/app/views/insights/pages/agents/llmOnboardingInstructions.tsx b/static/app/views/insights/pages/agents/llmOnboardingInstructions.tsx
index 6ca83ae1188468..95cf9be6aa5d36 100644
--- a/static/app/views/insights/pages/agents/llmOnboardingInstructions.tsx
+++ b/static/app/views/insights/pages/agents/llmOnboardingInstructions.tsx
@@ -57,8 +57,8 @@ Check in this order - **use the highest-level framework found** (e.g., if using
| Vercel AI SDK | \`Sentry.vercelAIIntegration()\` | - | - |
| LangGraph | \`Sentry.langGraphIntegration()\` | Auto-enabled | \`sentry-sdk[langgraph]\` |
| LangChain | \`Sentry.langChainIntegration()\` | Auto-enabled | \`sentry-sdk[langchain]\` |
-| OpenAI Agents | - | \`OpenAIAgentsIntegration()\` | - |
-| Pydantic AI | - | \`PydanticAIIntegration()\` | \`sentry-sdk[pydantic_ai]\` |
+| OpenAI Agents | - | Auto-enabled | - |
+| Pydantic AI | - | Auto-enabled | \`sentry-sdk[pydantic_ai]\` |
| LiteLLM | - | \`LiteLLMIntegration()\` | \`sentry-sdk[litellm]\` |
| OpenAI | \`Sentry.openAIIntegration()\` | Auto-enabled | - |
| Anthropic | \`Sentry.anthropicAIIntegration()\` | Auto-enabled | - |
From 8dcee3f1c207745ea41c7f88e07bba31840b0ba8 Mon Sep 17 00:00:00 2001
From: Ogi <86684834+obostjancic@users.noreply.github.com>
Date: Tue, 13 Jan 2026 14:39:36 +0100
Subject: [PATCH 6/8] fixes
---
.../pages/agents/llmOnboardingInstructions.tsx | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/static/app/views/insights/pages/agents/llmOnboardingInstructions.tsx b/static/app/views/insights/pages/agents/llmOnboardingInstructions.tsx
index 95cf9be6aa5d36..f1582ab832f2ee 100644
--- a/static/app/views/insights/pages/agents/llmOnboardingInstructions.tsx
+++ b/static/app/views/insights/pages/agents/llmOnboardingInstructions.tsx
@@ -1,20 +1,26 @@
import {Button} from 'sentry/components/core/button';
import {IconCopy} from 'sentry/icons';
import {t} from 'sentry/locale';
+import {trackAnalytics} from 'sentry/utils/analytics';
import useCopyToClipboard from 'sentry/utils/useCopyToClipboard';
+import useOrganization from 'sentry/utils/useOrganization';
export function CopyLLMPromptButton() {
const {copy} = useCopyToClipboard();
+ const organization = useOrganization();
return (
}
- onClick={() =>
+ onClick={() => {
+ trackAnalytics('agent-monitoring.copy-llm-prompt-click', {
+ organization,
+ });
copy(LLM_ONBOARDING_INSTRUCTIONS, {
successMessage: t('Copied instrumentation prompt to clipboard'),
- })
- }
+ });
+ }}
>
{t('Copy Prompt for AI Agent')}
@@ -182,8 +188,8 @@ with sentry_sdk.start_span(op="gen_ai.handoff", name=f"handoff from {a} to {b}")
## Key Rules
1. **All complex data must be JSON-stringified** - span attributes only accept primitives
-2. **\`gen_ai.request.model\` is required** on all AI request and agent spans
-3. **Nest spans correctly:** Agent span → contains Request spans and Tool spans (siblings)
+2. **\`gen_ai.request.model\` is required** on \`gen_ai.request\` and \`gen_ai.invoke_agent\` spans
+3. **Nest spans correctly:** \`gen_ai.invoke_agent\` spans should contain \`gen_ai.request\` and \`gen_ai.execute_tool\` spans as children
4. **JS min version:** \`@sentry/node@10.28.0\` or later
5. **Enable PII:** \`sendDefaultPii: true\` (JS) / \`send_default_pii=True\` (Python) to capture inputs/outputs
`;
From 96af6959e7b6ec530bc9433fffb560abe0dd0ed6 Mon Sep 17 00:00:00 2001
From: Ogi
Date: Tue, 13 Jan 2026 15:08:53 +0100
Subject: [PATCH 7/8] Update
static/app/views/insights/pages/agents/llmOnboardingInstructions.tsx
Co-authored-by: Simon Hellmayr
---
.../views/insights/pages/agents/llmOnboardingInstructions.tsx | 2 ++
1 file changed, 2 insertions(+)
diff --git a/static/app/views/insights/pages/agents/llmOnboardingInstructions.tsx b/static/app/views/insights/pages/agents/llmOnboardingInstructions.tsx
index f1582ab832f2ee..2f9107245f9f4c 100644
--- a/static/app/views/insights/pages/agents/llmOnboardingInstructions.tsx
+++ b/static/app/views/insights/pages/agents/llmOnboardingInstructions.tsx
@@ -149,6 +149,8 @@ with sentry_sdk.start_span(op="gen_ai.request", name=f"chat {model}") as span:
result = llm.generate(messages)
span.set_data("gen_ai.usage.input_tokens", result.input_tokens)
span.set_data("gen_ai.usage.output_tokens", result.output_tokens)
+ span.set_data("gen_ai.usage.input_tokens.cached", result.cached_tokens)
+
\`\`\`
### Invoke Agent
From de874eabcdb8ba41b61d42a17fb756a5dcdcfe9c Mon Sep 17 00:00:00 2001
From: Ogi <86684834+obostjancic@users.noreply.github.com>
Date: Tue, 13 Jan 2026 15:29:39 +0100
Subject: [PATCH 8/8] fix
---
static/app/utils/analytics/agentMonitoringAnalyticsEvents.tsx | 2 ++
1 file changed, 2 insertions(+)
diff --git a/static/app/utils/analytics/agentMonitoringAnalyticsEvents.tsx b/static/app/utils/analytics/agentMonitoringAnalyticsEvents.tsx
index 0385334b0c738a..47e77033273628 100644
--- a/static/app/utils/analytics/agentMonitoringAnalyticsEvents.tsx
+++ b/static/app/utils/analytics/agentMonitoringAnalyticsEvents.tsx
@@ -4,6 +4,7 @@ export type AgentMonitoringEventParameters = {
direction: 'asc' | 'desc';
table: string;
};
+ 'agent-monitoring.copy-llm-prompt-click': Record;
'agent-monitoring.drawer.open': Record;
'agent-monitoring.drawer.span-select': Record;
'agent-monitoring.drawer.view-full-trace-click': Record;
@@ -25,6 +26,7 @@ export const agentMonitoringEventMap: Record<
keyof AgentMonitoringEventParameters,
string
> = {
+ 'agent-monitoring.copy-llm-prompt-click': 'Agent Monitoring: Copy LLM Prompt Click',
'agent-monitoring.page-view': 'Agent Monitoring: Page View',
'agent-monitoring.table-switch': 'Agent Monitoring: Table Switch',
'agent-monitoring.column-sort': 'Agent Monitoring: Column Sort',