Sentry Setup AI Monitoring
LiorVainer/data-israel
Setup Sentry AI Agent Monitoring in any project. An agent skill from LiorVainer/data-israel.
Setup Sentry AI Agent Monitoring in any project. An agent skill from getsentry/sentry-for-ai.
$ npx skills add getsentry/sentry-for-ai --skill sentry-setup-ai-monitoring -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install getsentry/sentry-for-ai sentry-setup-ai-monitoring --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/getsentry/sentry-for-ai.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills-legacy/sentry-setup-ai-monitoring .claude/skills/sentry-setup-ai-monitoring && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "sentry-setup-ai-monitoring" agent skill from https://github.com/getsentry/sentry-for-ai/tree/main/skills-legacy/sentry-setup-ai-monitoring into .claude/skills/sentry-setup-ai-monitoring/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sentry-setup-ai-monitoring", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/getsentry/sentry-for-ai/tree/main/skills-legacy/sentry-setup-ai-monitoringType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add getsentry/sentry-for-ai --skill sentry-setup-ai-monitoring -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install getsentry/sentry-for-ai sentry-setup-ai-monitoring --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/getsentry/sentry-for-ai.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills-legacy/sentry-setup-ai-monitoring .agents/skills/sentry-setup-ai-monitoring && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "sentry-setup-ai-monitoring" agent skill from https://github.com/getsentry/sentry-for-ai/tree/main/skills-legacy/sentry-setup-ai-monitoring into .agents/skills/sentry-setup-ai-monitoring/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sentry-setup-ai-monitoring", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add getsentry/sentry-for-ai --skill sentry-setup-ai-monitoring -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install getsentry/sentry-for-ai sentry-setup-ai-monitoring --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/getsentry/sentry-for-ai.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills-legacy/sentry-setup-ai-monitoring .cursor/skills/sentry-setup-ai-monitoring && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "sentry-setup-ai-monitoring" agent skill from https://github.com/getsentry/sentry-for-ai/tree/main/skills-legacy/sentry-setup-ai-monitoring into .cursor/skills/sentry-setup-ai-monitoring/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sentry-setup-ai-monitoring", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/getsentry/sentry-for-ai.git --path skills-legacy/sentry-setup-ai-monitoring--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add getsentry/sentry-for-ai --skill sentry-setup-ai-monitoring -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install getsentry/sentry-for-ai sentry-setup-ai-monitoring --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/getsentry/sentry-for-ai.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills-legacy/sentry-setup-ai-monitoring .gemini/skills/sentry-setup-ai-monitoring && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "sentry-setup-ai-monitoring" agent skill from https://github.com/getsentry/sentry-for-ai/tree/main/skills-legacy/sentry-setup-ai-monitoring into .gemini/skills/sentry-setup-ai-monitoring/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sentry-setup-ai-monitoring", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install getsentry/sentry-for-ai sentry-setup-ai-monitoringInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add getsentry/sentry-for-ai --skill sentry-setup-ai-monitoring -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/getsentry/sentry-for-ai.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills-legacy/sentry-setup-ai-monitoring .github/skills/sentry-setup-ai-monitoring && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "sentry-setup-ai-monitoring" agent skill from https://github.com/getsentry/sentry-for-ai/tree/main/skills-legacy/sentry-setup-ai-monitoring into .github/skills/sentry-setup-ai-monitoring/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sentry-setup-ai-monitoring", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add getsentry/sentry-for-ai --skill sentry-setup-ai-monitoring -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install getsentry/sentry-for-ai sentry-setup-ai-monitoring --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/getsentry/sentry-for-ai.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills-legacy/sentry-setup-ai-monitoring .opencode/skills/sentry-setup-ai-monitoring && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "sentry-setup-ai-monitoring" agent skill from https://github.com/getsentry/sentry-for-ai/tree/main/skills-legacy/sentry-setup-ai-monitoring into .opencode/skills/sentry-setup-ai-monitoring/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sentry-setup-ai-monitoring", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
sentry-setup-ai-monitoringSetup Sentry AI Agent Monitoring in any project. An agent skill from getsentry/sentry-for-ai.
Sentry Setup AI Monitoring is an agent skill from getsentry/sentry-for-ai, published by the product's own GitHub organization. Setup Sentry AI Agent Monitoring in any project. Use when asked to monitor LLM calls, track AI agents, track conversations, or instrument OpenAI/Anthropic/Vercel AI/LangChain/Google GenAI/Pydantic AI/Laravel AI. Detects installed AI SDKs and configures appropriate integrations.
Its SKILL.md is about 5.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/sampling.md`).
It sits in AI & LLM Engineering, covering Building AI agents and Backend development. It works with Sentry, OpenAI, Laravel and LangChain. The repository describes itself as: Teach your AI coding assistant how to use Sentry - setup, debugging, alerts, and more. The licence is Apache-2.0.
Read from SKILL.md and the folder at commit c2313d3. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
composerphpFrom the folder's file list and the shell code blocks in SKILL.md.
Hosts in commands or code, which the agent is likely to contact:
docs.sentry.ioAlso links to:
getsentry.github.ioFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Sentry Setup AI Monitoring loads about 5.5k tokens when it runs, and up to ~6.2k if it reads all its reference files. Until then it costs about 76 tokens; SKILL.md has 1,779 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check noted patterns worth knowing about, such as sudo or a known installer.
_RATE|traces_sample_rate|traces_sampler' .env config/sentry.php 2>/dev/nullEnable tracing in `.env`:Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from getsentry/sentry-for-ai at commit c2313d3, republished under its Apache-2.0 licence (© getsentry). 1,779 words, ~5,456 tokens.
.claude/skills/sentry-setup-ai-monitoring/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.All Skills > Feature Setup > AI Monitoring
Configure Sentry to track LLM calls, agent executions, tool usage, and token consumption.
Important: The SDK versions, API names, and code samples below are examples. Always verify against docs.sentry.io before implementing, as APIs and minimum versions may have changed.
AI monitoring requires tracing enabled (tracesSampleRate > 0).
If the app has multi-turn chats, set a conversation ID by default anywhere it makes sense to identify a chat session. Sentry uses gen_ai.conversation.id to group related AI spans into Conversations. Some integrations infer it automatically, but many setups need to set it explicitly.
Prompt and output recording captures user content that is likely PII. In JavaScript, genAI input/output capture is on by default (governed by dataCollection.genAI); in Python it is enabled via send_default_pii=True; in Laravel it is enabled via SENTRY_SEND_DEFAULT_PII=true. Before relying on this capture (or per-integration overrides — recordInputs/recordOutputs in JS, include_prompts in Python), confirm:
Ask the user whether they want prompt/output capture enabled. Do not enable prompt/output capture without explicit confirmation. Use tracesSampleRate: 1.0 only in development; in production, use a lower value or a tracesSampler function.
Always detect installed AI SDKs before configuring:
# JavaScript
grep -E '"(openai|@anthropic-ai/sdk|ai|@langchain|@google/genai)"' package.json
# Python
grep -E '(openai|anthropic|langchain|huggingface)' requirements.txt pyproject.toml 2>/dev/null
# PHP / Laravel
grep -E '"(laravel/ai|openai-php|openai/|anthropic|llm)' composer.json 2>/dev/null
ls artisan 2>/dev/null && echo "Laravel detected"After detecting AI SDKs, check the current sampling configuration:
# JavaScript
grep -E 'tracesSampleRate|tracesSampler' sentry.*.config.* instrument.* src/instrument.* app/instrument.* 2>/dev/null
# Python
grep -E 'traces_sample_rate|traces_sampler' *.py **/*.py 2>/dev/null
# PHP / Laravel
grep -E 'SENTRY_TRACES_SAMPLE_RATE|traces_sample_rate|traces_sampler' .env config/sentry.php 2>/dev/nullIf tracesSampleRate / traces_sample_rate is below 1.0 AND no tracesSampler / traces_sampler is configured:
Ask the user:
"Your current sample rate is {rate}. Agent runs are sampled as complete span trees — if the root span is dropped, all child gen_ai spans are lost. For full AI visibility, gen_ai-related transactions should be sampled at 100%. Would you like me to set up a
tracesSamplerthat keeps AI traces at 100% while sampling other traffic at your current rate?"
If user confirms, read ${SKILL_ROOT}/references/sampling.md for implementation patterns.
| Package | Integration | Min Sentry SDK | Auto? |
|---|---|---|---|
openai | openAIIntegration() | 10.53.0 | Yes |
@anthropic-ai/sdk | anthropicAIIntegration() | 10.53.0 | Yes |
ai (Vercel) | vercelAIIntegration() | 10.53.0 | Yes* |
@langchain/* | langChainIntegration() | 10.53.0 | Yes |
@langchain/langgraph | langGraphIntegration() | 10.53.0 | Yes |
@google/genai | googleGenAIIntegration() | 10.53.0 | Yes |
*Vercel AI: 10.53.0+ required. Requires experimental_telemetry per-call.
Integrations auto-enable when the AI package is installed — no explicit registration needed:
| Package | Auto? | Notes |
|---|---|---|
openai | Yes | Includes OpenAI Agents SDK |
anthropic | Yes | |
langchain / langgraph | Yes | |
huggingface_hub | Yes | |
google-genai | Yes | |
pydantic-ai | Yes | |
litellm | No | Requires explicit integration |
mcp (Model Context Protocol) | Yes |
| Package | Integration | Min Sentry SDK | Auto? |
|---|---|---|---|
laravel/ai | Laravel AI instrumentation in sentry/sentry-laravel | 4.27.0 | Yes |
Laravel AI support requires Laravel 12.x or later, sentry/sentry-laravel 4.27.0 or later, and tracing enabled.
Just ensure tracing is enabled. Integrations auto-enable when the AI package is installed:
Sentry.init({
dsn: "YOUR_DSN",
tracesSampleRate: 1.0, // Lower in production (e.g., 0.1)
// OpenAI, Anthropic, Google GenAI, LangChain integrations auto-enable in Node.js
});To customize (e.g., enable prompt capture after user confirmation — see Data Capture Warning):
Sentry.init({
dsn: "YOUR_DSN",
tracesSampleRate: 1.0,
dataCollection: {
// To disable sending user data and HTTP bodies, uncomment the lines below. For more info visit:
// https://docs.sentry.io/platforms/javascript/configuration/options/#dataCollection
// userInfo: false,
// httpBodies: [],
},
integrations: [
Sentry.openAIIntegration({
// recordInputs/recordOutputs default to true (governed by dataCollection.genAI)
}),
],
});The Workers runtime (workerd) does not support monkey-patching, so Node.js-style auto-instrumentation does not apply. Workers AI (env.AI) is auto-instrumented by withSentry (v10.67.0+); openai, @anthropic-ai/sdk, @google/genai, and ai need either the build-time Sentry Cloudflare Vite plugin (v10.68.0+, experimental) or manual client wrapping; LangChain/LangGraph are manual-only. Read ${SKILL_ROOT}/../../references/sdks/cloudflare/ai-monitoring.md for the full setup.
In browser-side code or Next.js meta-framework apps, auto-instrumentation is not available. Wrap the client manually:
import OpenAI from "openai";
import * as Sentry from "@sentry/nextjs"; // or @sentry/react, @sentry/browser
const openai = Sentry.instrumentOpenAiClient(new OpenAI());
// Use 'openai' client as normalSentry.init({
dsn: "YOUR_DSN",
tracesSampleRate: 1.0,
dataCollection: {
// To disable sending user data and HTTP bodies, uncomment the lines below. For more info visit:
// https://docs.sentry.io/platforms/javascript/configuration/options/#dataCollection
// userInfo: false,
// httpBodies: [],
},
integrations: [
Sentry.langChainIntegration(),
Sentry.langGraphIntegration(),
],
});Add to sentry.edge.config.ts for Edge runtime:
Sentry.init({
dsn: "YOUR_DSN",
tracesSampleRate: 1.0,
dataCollection: {
// To disable sending user data and HTTP bodies, uncomment the lines below. For more info visit:
// https://docs.sentry.io/platforms/javascript/configuration/options/#dataCollection
// userInfo: false,
// httpBodies: [],
},
integrations: [Sentry.vercelAIIntegration()],
});Enable telemetry per-call:
await generateText({
model: openai("gpt-4o"),
prompt: "Hello",
experimental_telemetry: {
isEnabled: true,
recordInputs: true,
recordOutputs: true,
},
});Integrations auto-enable — just init with tracing. Only add explicit imports to customize options:
import sentry_sdk
sentry_sdk.init(
dsn="YOUR_DSN",
traces_sample_rate=1.0, # Lower in production (e.g., 0.1)
send_default_pii=True,
# Integrations auto-enable when the AI package is installed.
# Only specify explicitly to customize (e.g., include_prompts):
# integrations=[OpenAIIntegration(include_prompts=True)],
)Laravel AI instrumentation auto-enables when both sentry/sentry-laravel and laravel/ai are installed and tracing is active.
composer require sentry/sentry-laravel "^4.27.0"
composer require laravel/ai
php artisan vendor:publish --provider="Laravel\Ai\AiServiceProvider"
php artisan migrateEnable tracing in .env:
SENTRY_TRACES_SAMPLE_RATE=1.0To include LLM prompts, tool arguments, and responses after explicit user confirmation, enable PII capture:
SENTRY_SEND_DEFAULT_PII=trueSentry treats LLM and tool inputs/outputs as PII and does not capture them by default. Do not enable SENTRY_SEND_DEFAULT_PII=true without confirming the Data Capture Warning above.
The Laravel integration captures these span types automatically:
| Span op | Purpose |
|---|---|
gen_ai.invoke_agent | Agent prompt lifecycle |
gen_ai.chat | AI provider chat requests |
gen_ai.execute_tool | Laravel AI tool executions |
gen_ai.embeddings | Embedding generation |
For detailed Laravel setup, verification, Conversations behavior, and feature flags, read ${SKILL_ROOT}/../../references/sdks/php/ai-monitoring.md.
Use when no supported SDK is detected. Follow the canonical Sentry Conventions for gen_ai.* attributes — the JS docs may lag behind; do not set attributes marked deprecated in the conventions.
op | Span name pattern | Purpose |
|---|---|---|
gen_ai.{operation} (e.g. gen_ai.chat, gen_ai.request) | {operation} {model} (e.g. chat gpt-4o) | Individual LLM call |
gen_ai.invoke_agent | invoke_agent {agent_name} | Agent execution lifecycle |
gen_ai.execute_tool | execute_tool {tool_name} | Tool/function call |
gen_ai.handoff | handoff from {source} to {target} | Agent-to-agent transition |
For LLM-call spans, the op follows the pattern gen_ai.{gen_ai.operation.name} — use gen_ai.chat, gen_ai.embeddings, gen_ai.generate_content, or gen_ai.text_completion where the operation is known. Span attributes only accept primitives; arrays/objects must be JSON-stringified.
const inputMessages = [
{ role: "user", parts: [{ type: "text", content: "Tell me a joke" }] },
];
await Sentry.startSpan({
op: "gen_ai.chat",
name: "chat gpt-4o",
attributes: {
"gen_ai.request.model": "gpt-4o",
"gen_ai.operation.name": "chat",
"gen_ai.input.messages": JSON.stringify(inputMessages),
},
}, async (span) => {
const result = await llmClient.complete(inputMessages);
const outputMessages = [
{
role: "assistant",
parts: [
// Thinking/reasoning content goes in a `reasoning` part, NOT a `text` part.
// Sentry surfaces it separately and filters it out of the Conversations view.
{ type: "reasoning", content: result.reasoning },
{ type: "text", content: result.text },
],
finish_reason: result.finishReason,
},
];
span.setAttribute("gen_ai.output.messages", JSON.stringify(outputMessages));
span.setAttribute("gen_ai.usage.input_tokens", result.inputTokens);
span.setAttribute("gen_ai.usage.output_tokens", result.outputTokens);
return result;
});Common (all AI spans):
| Attribute | Required | Description |
|---|---|---|
gen_ai.request.model | Yes | Model identifier (e.g., gpt-4o, claude-sonnet-4-6) |
gen_ai.operation.name | No | Operation label (chat, embeddings, invoke_agent, execute_tool, handoff, etc.) |
gen_ai.agent.name | No | Agent name (set on agent and tool spans) |
Model config (LLM call spans):
| Attribute | Description |
|---|---|
gen_ai.request.reasoning_effort | Reasoning effort level for reasoning models (e.g., low, medium, high). Supported values vary by provider. |
Request / response content (PII — enable only after confirming; see Data Capture Warning above):
| Attribute | Description |
|---|---|
gen_ai.input.messages | JSON-stringified array of input messages. Each item uses {role, parts} where parts is [{type, content}]; role is "user", "assistant", "tool", or "system". Common part types: "text", "reasoning", "tool_call", "tool_call_response" |
gen_ai.output.messages | JSON-stringified array of response messages (text + tool calls), same shape as inputs |
Thinking / reasoning messages: Models with extended thinking (Anthropic thinking blocks, Gemini thought, DeepSeek reasoning_content) produce internal reasoning that isn't part of the user-visible reply. Represent it as a reasoning part inside the assistant message — {"type": "reasoning", "content": "..."} — alongside the user-facing text part. Sentry surfaces reasoning parts separately and filters them out of the user-facing Conversations view, so do not fold thinking into a text part. When previous thinking is fed back into a multi-turn request, include the same reasoning parts in the assistant messages within gen_ai.input.messages. Record reasoning token counts via gen_ai.usage.output_tokens.reasoning (a subset of gen_ai.usage.output_tokens).
| gen_ai.system_instructions | System prompt passed to the model |
| gen_ai.tool.definitions | JSON-stringified list of tools available to the model |
Token usage:
| Attribute | Description |
|---|---|
gen_ai.usage.input_tokens | Total input tokens — includes cached tokens |
gen_ai.usage.input_tokens.cached | Subset of input tokens served from cache |
gen_ai.usage.input_tokens.cache_write | Tokens written to cache while processing input |
gen_ai.usage.output_tokens | Total output tokens — includes reasoning tokens |
gen_ai.usage.output_tokens.reasoning | Subset of output tokens used for reasoning |
gen_ai.usage.total_tokens | Sum of input + output tokens |
Tool spans (gen_ai.execute_tool):
| Attribute | Description |
|---|---|
gen_ai.tool.name | Tool identifier |
gen_ai.tool.description | Human-readable tool description |
gen_ai.tool.call.arguments | JSON-stringified tool arguments |
gen_ai.tool.call.result | JSON-stringified tool result |
Sentry uses token attributes to calculate model costs. Cached and reasoning tokens are subsets, not separate counts — gen_ai.usage.input_tokens already includes gen_ai.usage.input_tokens.cached, and gen_ai.usage.output_tokens already includes gen_ai.usage.output_tokens.reasoning.
Sentry subtracts the cached/reasoning counts from the totals to compute the uncached/non-reasoning portion. Reporting a cached or reasoning count greater than its total produces negative costs in the dashboard.
Example — 100 input tokens total, 90 served from cache:
input_tokens = 100, input_tokens.cached = 90input_tokens = 10, input_tokens.cached = 90 (cached larger than total → negative cost)The same rule applies to gen_ai.usage.output_tokens vs. gen_ai.usage.output_tokens.reasoning.
After configuring, make an LLM call and check the Sentry Traces dashboard. AI spans appear with gen_ai.* operations showing model, token counts, and latency.
Conversations gives a readable, chat-style view of past sessions with your AI agent. It groups spans by gen_ai.conversation.id — so whether a user talked across multiple traces or multiple conversations happened inside one trace, you get a timeline of every message, tool call, and response.
When the user asks for AI monitoring setup, proactively mention this requirement if the app has multi-turn chats. Without a conversation ID, the agent-monitoring spans still work, but the Conversations view cannot group the session correctly.
Find it at Explore > Conversations in Sentry.
tracesSampleRate > 0streamGenAiSpans defaults to true since JS SDK 10.61.0 and stream_gen_ai_spans defaults to True since Python SDK 2.64.0. This sends AI spans as standalone items, so spans with large inputs/outputs don't hit transaction payload size limits and get dropped. (The options are available since JS 10.53.0 / Python 2.60.0 if you need to set them explicitly on older SDKs.)gen_ai.input.messages and gen_ai.output.messages attributes. In JS this is on by default (via dataCollection); in Python, set send_default_pii=True; in Laravel, set SENTRY_SEND_DEFAULT_PII=true. Without it, conversations appear empty.Some integrations (OpenAI Agents SDK for Python, OpenAI SDK for Node, Laravel AI agents using Conversational + RemembersConversations) infer the conversation ID automatically. For all others, set it manually.
Use a short, opaque identifier — alphanumeric characters with dashes or underscores only. Never use a URL, email address, or other free-form text as the conversation ID: Sentry uses it as a URL path segment, and a value containing a slash breaks Conversations for that session.
Good examples:
48e35936-82ab-4f1a-beaf-b2fa4273ac5econv_5j66UpCpwteGg4YSxUnt7lPYU, asst_abc12345, sess_987654import * as Sentry from "@sentry/node"; // or @sentry/nextjs, @sentry/nestjs, etc.
// Set at the start of a conversation
Sentry.setConversationId("conv_abc123");
// All subsequent AI calls carry gen_ai.conversation.id: "conv_abc123"
await openai.chat.completions.create({
model: "gpt-5.5",
messages: [{ role: "user", content: "Hello" }],
});import sentry_sdk.ai
# Set at the start of a conversation
sentry_sdk.ai.set_conversation_id("conv_abc123")
# All subsequent AI calls carry gen_ai.conversation.id = "conv_abc123"Some integrations infer the conversation ID automatically. For example, the Python OpenAI integration picks it up when you use the conversation parameter:
import openai
import sentry_sdk
sentry_sdk.init(...)
conversation = openai.conversations.create()
response = openai.responses.create(
model="gpt-5.4",
input=[{"role": "user", "content": "What are the 5 Ds of dodgeball?"}],
conversation=conversation.id # automatically sets gen_ai.conversation.id
)The Conversations view shows a User column. To populate it, call setUser / set_user once per request or session, before any AI calls:
import * as Sentry from "@sentry/node"; // or @sentry/nextjs, @sentry/nestjs, etc.
Sentry.setUser({ id: "user_123", email: "jane@example.com", username: "jane" });import sentry_sdk
sentry_sdk.set_user({"id": "user_123", "email": "jane@example.com", "username": "jane"})Any of id, email, or username is sufficient — Conversations will display whichever fields are present.
These are independent concepts:
| Issue | Solution |
|---|---|
| AI spans not appearing | Verify tracesSampleRate > 0, check SDK version |
| Token counts missing | Some providers don't return tokens for streaming |
| Negative or wrong costs in dashboard | Cached/reasoning tokens are subsets of totals — see Token Usage and Cost Calculation |
| Prompts not captured | In JS, genAI capture is on by default — ensure you haven't set dataCollection: { genAI: { inputs: false } }, or pass recordInputs: true explicitly. In Python, set send_default_pii=True; in Laravel, set SENTRY_SEND_DEFAULT_PII=true. Use include_prompts only for explicit Python overrides |
| Vercel AI not working | Add experimental_telemetry to each call |
| Laravel AI spans not appearing | Verify sentry/sentry-laravel >=4.27.0, laravel/ai is installed, and SENTRY_TRACES_SAMPLE_RATE > 0 |
| Conversations view empty | Ensure Gen AI span streaming is enabled (default since JS SDK 10.61.0 / Python SDK 2.64.0), genAI input/output capture enabled (on by default in JS via dataCollection; send_default_pii=True in Python; SENTRY_SEND_DEFAULT_PII=true in Laravel), and a conversation ID is set |
| User column shows "Unknown" | Call Sentry.setUser() (JS) or sentry_sdk.set_user() (Python) once per request or session |
© getsentry, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 1 other file (references) in skills-legacy/sentry-setup-ai-monitoring of getsentry/sentry-for-ai.
Open the folder on GitHubat commit c2313d3
Sentry Setup AI Monitoring next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Sentry Setup AI Monitoring this skillgetsentry/sentry-for-ai | 268 | — | ~5.5k | Automated safety check: Notes | Apache-2.0 | |
| Sentry Setup AI MonitoringLiorVainer/data-israel | 130 | — | ~1.8k | Automated safety check: Pass | Apache-2.0 | |
| Agent Inspectrajudandigam/agent-inspect | 165 | — | ~424 | Automated safety check: Pass | MIT | |
| Bootstrapping Agentairbytehq/airbyte-agent-sdk | 135 | — | ~1.7k | Automated safety check: Notes | Custom licence | |
| Upgrade Stripekanchengw/cnllm | 173 | 3 repos | ~1.4k | Automated safety check: Pass | Apache-2.0 | |
| Reachai Onboardingw8123/EnterpriseAgentFramework | 865 | — | ~6.1k | Automated safety check: Pass | MIT |
LiorVainer/data-israel
Setup Sentry AI Agent Monitoring in any project. An agent skill from LiorVainer/data-israel.
rajudandigam/agent-inspect
Local evidence debugger and trajectory-test toolkit for TypeScript AI agents.
airbytehq/airbyte-agent-sdk
Wires up an Airbyte connector for use in a PydanticAI, Claude SDK, or other agent.
kanchengw/cnllm
Guide for upgrading Stripe API versions and SDKs. An agent skill from kanchengw/cnllm.
w8123/EnterpriseAgentFramework
Integrate Java business systems with ReachAI SDK registration, SDK instance heartbeat, gateway/embed access, and optional API Management handoff.
aiskillstore/marketplace
Integrate applications with RouterBase, the OpenAI-compatible model gateway at https://routerbase.com/v1.
getsentry/sentry-for-ai
Full Sentry SDK setup for Elixir. An agent skill from getsentry/sentry-for-ai.
getsentry/sentry-for-ai
Full Sentry SDK setup for Go. An agent skill from getsentry/sentry-for-ai.
getsentry/sentry-for-ai
Full Sentry SDK setup for Next.js. An agent skill from getsentry/sentry-for-ai.
getsentry/sentry-for-ai
Full Sentry SDK setup for PHP. An agent skill from getsentry/sentry-for-ai.
getsentry/sentry-for-ai
Full Sentry SDK setup for Python. An agent skill from getsentry/sentry-for-ai.
getsentry/sentry-for-ai
Full Sentry SDK setup for React Router Framework mode. An agent skill from getsentry/sentry-for-ai.
Categories
Setup Sentry AI Agent Monitoring in any project. An agent skill from getsentry/sentry-for-ai. Sentry Setup AI Monitoring is an agent skill from getsentry/sentry-for-ai, published by the product's own GitHub organization. Setup Sentry AI Agent Monitoring in any project.
Sentry Setup AI Monitoring fits situations like: asked to monitor LLM calls; track AI agents; track conversations; instrument OpenAI/Anthropic/Vercel AI/LangChain/Google GenAI/Pydantic AI/Laravel AI.
Run `npx skills add getsentry/sentry-for-ai --skill sentry-setup-ai-monitoring -a claude-code`. Or copy the skill folder (skills-legacy/sentry-setup-ai-monitoring in getsentry/sentry-for-ai) into .claude/skills/sentry-setup-ai-monitoring in your project. Claude Code loads it when a task matches its description.
Run `npx skills add getsentry/sentry-for-ai --skill sentry-setup-ai-monitoring -a codex`. Or copy the skill folder (skills-legacy/sentry-setup-ai-monitoring in getsentry/sentry-for-ai) into .agents/skills/sentry-setup-ai-monitoring in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add getsentry/sentry-for-ai --skill sentry-setup-ai-monitoring -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/sentry-setup-ai-monitoring, .gemini/skills/sentry-setup-ai-monitoring, .github/skills/sentry-setup-ai-monitoring and .opencode/skills/sentry-setup-ai-monitoring in your project.
Going by SKILL.md and its folder, Sentry Setup AI Monitoring needs the command-line tools its instructions call (composer and php). Our summary lists: Python 3; Node.js.
SKILL.md names 2 domains. In commands or code: docs.sentry.io; the agent is likely to contact it when it follows the instructions. As links in the text: getsentry.github.io. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.
Sentry Setup AI Monitoring is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 5.5k tokens (SKILL.md is roughly 22k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 760 tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Sentry Setup AI Monitoring: Sentry Setup AI Monitoring (LiorVainer/data-israel, 130 stars), Agent Inspect (rajudandigam/agent-inspect, 165 stars), Bootstrapping Agent (airbytehq/airbyte-agent-sdk, 135 stars) and Upgrade Stripe (kanchengw/cnllm, 173 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
getsentry (a GitHub organization, an official publisher) maintains it in getsentry/sentry-for-ai, which has 268 GitHub stars. The repository holds 32 skills in this directory. The repository was last updated on October 9, 2026.
Source: getsentry/sentry-for-ai on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.