diff --git a/docs/concepts/otlp/direct/claude-platform.mdx b/docs/concepts/otlp/direct/claude-platform.mdx new file mode 100644 index 0000000000000..c543d96ab5f4c --- /dev/null +++ b/docs/concepts/otlp/direct/claude-platform.mdx @@ -0,0 +1,71 @@ +--- +title: Claude Platform +sidebar_title: Claude Platform +sidebar_order: 30 +description: "Send OpenTelemetry traces from Claude Managed Agents and the Claude Messages API to Sentry, with no code changes." +keywords: + [ + "anthropic", + "claude", + "claude platform", + "claude console", + "claude managed agents", + "messages api", + "otlp", + "opentelemetry", + "agent tracing", + ] +--- + + + +The Claude Platform exports OpenTelemetry traces for Claude Managed Agents sessions and Messages API requests. Add Sentry as a destination in the Claude Console, and each agent turn, model request, and tool call shows up in [Agents](/product/agents/) in the same Sentry project as your errors and backend spans. You don't need to install a Sentry SDK or change any code. + +OpenTelemetry export on the Claude Platform is in beta, so span names and attributes can change. Console destinations work with the Claude API and Claude Platform on AWS. Requests sent through Amazon Bedrock or Google Cloud Vertex AI aren't traced this way. To trace those, use the Claude SDK instead (see [Trace Your Own Code](#trace-your-own-code)). + +## Prerequisites + +- A Sentry project for your agent +- The admin role in a [Claude Console](https://platform.claude.com/) organization + +## Copy Your Sentry DSN + +Go to [Project settings > Client Keys (DSN)](https://sentry.io/orgredirect/organizations/:orgslug/settings/projects/:projectId/keys/) for the project you want to send traces to, and copy the **DSN**. The Claude Console uses it to find your project's OTLP endpoint and authentication key. + +## Add Sentry as a Destination + +In the [Claude Console](https://platform.claude.com/), open the **OpenTelemetry** settings page for your organization and click **Add destination**. One destination covers both Claude Managed Agents sessions and Messages API requests. + +- **Provider**: Select **Sentry**. +- **DSN**: Paste the DSN that you copied. +- **Content mode**: Select **Full content** to see prompts, responses, and tool input and output in Sentry. Select **Metadata only** to send only timing, status, and token counts. +- **Set as organization default**: Select this for your first destination. + +![Add destination dialog in the Claude Console with Sentry selected as the provider =500x](./img/claude-platform-otel-console-sentry-destination.jpg) + +To send a workspace's traces to a different Sentry project, add a destination to that workspace. A workspace destination replaces the organization default for that workspace. + +See the [Claude Console docs](https://platform.claude.com/docs/en/manage-claude/opentelemetry#add-a-destination) for all destination options. + +## Verify Your Setup + +Send a Messages API request with an API key from a workspace that uses the destination, or run a Claude Managed Agents session. After the first traces are sent, the **Delivery** column on the Claude Console OpenTelemetry settings page changes to **Healthy**. + +Then open [**Explore > Agents**](https://sentry.io/orgredirect/organizations/:orgslug/explore/agents/) in Sentry. Your session or request shows up on the **Conversations**, **Traces**, and **LLM Calls** tabs. Select a conversation and open the **Timeline** tab to see each turn, model request, and tool call with its duration and token usage. + +![Sentry conversation timeline for a Claude Managed Agents session, showing model request and tool call spans =700x](./img/claude-platform-otel-conversation-timeline.jpg) + +The Claude Platform puts the conversation on agent spans, and tool input and output on tool spans. To read prompts and tool results, select a tool span or open the **Transcript** tab. Model request spans don't include prompts. + +## Data and Privacy + +Prompts and responses are only sent to Sentry if you select **Full content** for the destination. Sentry stores what it receives under your project's retention and [data scrubbing](/security-legal-pii/scrubbing/) settings. Spans are billed the same way as other Sentry tracing data. + +## Trace Your Own Code + +The Claude Platform export covers the requests that Claude handles. To also see your application code and the tools it runs for Claude in the same trace, instrument your app with the Claude SDK or a Sentry SDK: + +- [Trace the Claude TypeScript SDK with OpenTelemetry](https://sentry.io/cookbook/trace-claude-typescript-sdk-with-opentelemetry/) +- [Trace the Claude Python SDK with OpenTelemetry](https://sentry.io/cookbook/trace-claude-python-sdk-with-opentelemetry/) +- [Sentry Anthropic integration for JavaScript](/platforms/javascript/guides/node/configuration/integrations/anthropic/) +- [Sentry Anthropic integration for Python](/platforms/python/agent-tracing/anthropic/) diff --git a/docs/concepts/otlp/direct/img/claude-platform-otel-console-sentry-destination.jpg b/docs/concepts/otlp/direct/img/claude-platform-otel-console-sentry-destination.jpg new file mode 100644 index 0000000000000..8698cc14105c0 Binary files /dev/null and b/docs/concepts/otlp/direct/img/claude-platform-otel-console-sentry-destination.jpg differ diff --git a/docs/concepts/otlp/direct/img/claude-platform-otel-conversation-timeline.jpg b/docs/concepts/otlp/direct/img/claude-platform-otel-conversation-timeline.jpg new file mode 100644 index 0000000000000..a76c6f8d1b158 Binary files /dev/null and b/docs/concepts/otlp/direct/img/claude-platform-otel-conversation-timeline.jpg differ diff --git a/docs/concepts/otlp/direct/index.mdx b/docs/concepts/otlp/direct/index.mdx index e9118fc006018..cd8780dcbd77b 100644 --- a/docs/concepts/otlp/direct/index.mdx +++ b/docs/concepts/otlp/direct/index.mdx @@ -18,3 +18,4 @@ If you need to collect data from infrastructure, transform data, or route to mul - [Traces](/concepts/otlp/direct/traces/) - Send OTel traces to Sentry - [Logs](/concepts/otlp/direct/logs/) - Send OTel logs to Sentry +- [Claude Platform](/concepts/otlp/direct/claude-platform/) - Send traces from Claude Managed Agents and the Messages API to Sentry diff --git a/docs/product/agents/getting-started.mdx b/docs/product/agents/getting-started.mdx index d7eb1d4e149bf..eff22be0f0183 100644 --- a/docs/product/agents/getting-started.mdx +++ b/docs/product/agents/getting-started.mdx @@ -8,6 +8,7 @@ keywords: - agent tracing setup - OpenAI integration - Anthropic integration + - Claude Platform - LangChain integration - Python AI - Node.js AI @@ -26,6 +27,7 @@ To use [Conversations](/product/agents/conversations/), set a conversation ID fo To start sending agent data to Sentry, make sure you've created a Sentry project for your AI-enabled repository and follow one of the guides below: +- [Claude Platform](/concepts/otlp/direct/claude-platform/) - [Cloudflare](/platforms/javascript/guides/cloudflare/agent-tracing/) - [Eve](/platforms/javascript/guides/eve/) - [Flue](/platforms/javascript/guides/flue/) diff --git a/src/components/home.tsx b/src/components/home.tsx index 1620eb3c8a3b5..43059e9e1acd3 100644 --- a/src/components/home.tsx +++ b/src/components/home.tsx @@ -157,7 +157,27 @@ export function Home() { {' '} with one of these agent integrations.

-
+
+ } + /> + } + /> + } + /> } /> - } - /> - } - />