Trace Claude Managed Agents and the Messages API in Sentry
The Claude Platform exports OpenTelemetry (OTel) traces natively. Select Sentry as a destination in the Claude Console, paste your DSN, and see every model call, tool call, and token from Claude Managed Agents and the Messages API, with no code to change.
Before you start
Accounts & access
- Sentry account with a project for your agent
- Admin role in a Claude Console organization
Knowledge
- Basic familiarity with the Claude Messages API or Claude Managed Agents
1 Copy your Sentry DSN
Go to Settings → Projects, select the project for your agent, and open Client Keys (DSN). Copy the DSN. The Claude Console uses it to find your project's OpenTelemetry Protocol (OTLP) endpoint and authentication key.
Sentry OTLP ingestion docs 2 Add Sentry as a destination in the Claude Console
In the Claude Console, open the OpenTelemetry settings page of your organization and click Add destination. This one setting covers Claude Managed Agents sessions and Messages API requests.
- Provider: select Sentry.
- DSN: paste the DSN from step 1.
- Content mode: Full content to read prompts, responses, and tool input and output in Sentry, or Metadata only for timing, status, and token counts.
- Set as organization default: select it for your first destination. To send one workspace to a different Sentry project, add a destination to that workspace instead.
3 Check that traces arrive
Send a Messages API request with an API key from a workspace that uses the destination, or run a Claude Managed Agents session. In the Claude Console, the Delivery column on the OpenTelemetry settings page changes to Healthy after the first traces are sent. Then open Agents under Explore in Sentry. Your session or request shows on the Conversations, Traces, and LLM Calls tabs. Select a conversation, open the Timeline tab, and select a tool call to see its input and output.
4 Explore Claude agent conversations in Sentry
Open Agents under Explore in Sentry. The charts at the top show estimated cost, agent runs, and tool calls over time. On the Conversations tab, each Claude Managed Agents session thread, and each conversation_id that you set in the SDK, is one row with its messages, errors, cost, and tools. Select a row to open the conversation. The Transcript tab shows the messages and each tool call in order, and marks failed tool calls as errors. The Timeline tab shows each turn, model request, and tool call with its duration and tokens.
That's it.
Every model call, tool call, and token. In the trace you already debug.
Claude agent traces land in the same Sentry project as your errors and backend spans, so you can debug a failed agent run, find slow tool calls, and track token spend without a new tool.
- Copied the DSN of your Sentry project
- Added Sentry as an OpenTelemetry destination in the Claude Console
- Sent traces from Claude Managed Agents and the Messages API with no code changes
- Read Claude agent conversations, tool calls, and token usage in Sentry
Pro tips
- 💡 Use Full content for the destination. Without prompts and responses, you see that a run failed, but not why.
- 💡 Give each Claude workspace its own destination to send each agent to its own Sentry project.
- 💡 Add the Claude SDK to your application to see your own spans and each tool that your code runs in the same trace. See the recipes for TypeScript and Python.
Common pitfalls
- ⚠️ Looking for prompts on model request spans. The Claude Platform puts the conversation on the agent spans and tool input and output on the tool spans. Select a tool span, or use the Transcript tab.
- ⚠️ Sending requests with an API key from a workspace that has its own destination. A workspace destination replaces the organization default, so the traces of that workspace go only to its own destination.
Frequently asked questions
What's next?
Fix it, don't observe it.
Get started with the only application monitoring platform that empowers developers to fix application problems without compromising on velocity.