Skip to content

Conversation

@priscilawebdev
Copy link
Member

@priscilawebdev priscilawebdev commented Jan 16, 2026

  • Separate server-side and browser-side usage sections for clarity
  • Document anthropicAIIntegration for Node.js platforms (auto-enabled by default)
  • Document instrumentAnthropicAiClient for browser and edge runtimes
  • Add special handling for Cloudflare Workers edge runtime
  • Simplify code examples by omitting import statements
  • Move configuration and supported versions to shared sections
  • Improve platform-specific visibility using PlatformSection components

closes https://linear.app/getsentry/issue/TET-1738/anthropic-ai-integration-restructure-and-improve-docs

@vercel
Copy link

vercel bot commented Jan 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
sentry-docs Ready Ready Preview, Comment Jan 19, 2026 10:06am
1 Skipped Deployment
Project Deployment Review Updated (UTC)
develop-docs Ignored Ignored Preview Jan 19, 2026 10:06am

Request Review

@linear
Copy link

linear bot commented Jan 16, 2026


_Import name: `Sentry.anthropicAIIntegration`_

The `anthropicAIIntegration` adds instrumentation for the `@anthropic-ai/sdk` API to capture spans by wrapping Anthropic client calls and recording LLM interactions.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `anthropicAIIntegration` adds instrumentation for the `@anthropic-ai/sdk` API to capture spans by wrapping Anthropic client calls and recording LLM interactions.
The `anthropicAIIntegration` adds instrumentation for the `@anthropic-ai/sdk` SDK to capture spans by wrapping Anthropic client calls and recording LLM interactions.

l: Maybe SDK? Reads kind of weird as API, feel free to disregard tho. Maybe @inventarSarah has another opinion.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'd also opt for "SDK"👍

<Alert>

This integration works in the Node.js, Cloudflare Workers, Vercel Edge Functions, and browser runtimes. It requires SDK version `10.12.0` or higher.
This integration is **enabled by default for Node.js-based platforms** and automatically captures spans for Anthropic API method calls. It requires SDK version `10.12.0` or higher.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: Couldn't we just conditionally reword this and show it for environments where it's enabled by default via PlatformSelection? e.g.

This integration is enabled by default and automatically captures spans for Anthropic API method calls [..]

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please also add which SDK we mean here:

It requires SDK version 10.12.0 or higher.


<PlatformSection supported={["javascript"]}>
For browser applications, you need to manually instrument the Anthropic client using the `instrumentAnthropicAiClient` helper:
The `instrumentAnthropicAiClient` helper adds instrumentation for the `@anthropic-ai/sdk` API to capture spans by wrapping Anthropic client calls and recording LLM interactions with configurable input/output recording. You need to manually wrap your Anthropic client instance with this helper. See example below:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `instrumentAnthropicAiClient` helper adds instrumentation for the `@anthropic-ai/sdk` API to capture spans by wrapping Anthropic client calls and recording LLM interactions with configurable input/output recording. You need to manually wrap your Anthropic client instance with this helper. See example below:
The `instrumentAnthropicAiClient` helper adds instrumentation for the `@anthropic-ai/sdk` SDK to capture spans by wrapping Anthropic client calls and recording LLM interactions with configurable input/output recording. You need to manually wrap your Anthropic client instance with this helper. See example below:

m: Above you're talking about "Anthropic API method calls", but here's you're just mentioning "Anthropic client calls". Can we align these?

</PlatformSection>

_Type: `boolean`_
<PlatformSection supported={["javascript", "javascript.react", "javascript.angular", "javascript.vue", "javascript.svelte", "javascript.solid", "javascript.ember", "javascript.gatsby", "javascript.nextjs", "javascript.nuxt", "javascript.solidstart", "javascript.sveltekit", "javascript.react-router", "javascript.remix", "javascript.astro", "javascript.tanstackstart-react", "javascript.electron", "javascript.cloudflare"]}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l: Maybe we can invert this and just use notSupported={["javascript.node"]}, as far as I can tell, that's the only SDK where we can for sure tell that users don't need to know about manual instrumentation, right?

By default this integration adds tracing support to Anthropic API method calls including:
## Supported Operations

By default, tracing support is added to the following Anthropic API method calls:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l: Same request around aligning messaging around "Anthropic API method calls"

```

</PlatformSection>
Streaming and non-streaming requests are automatically detected and handled appropriately.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: do we need to explain what "handled appropriately" means?

Copy link
Contributor

@coolguyzone coolguyzone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants