Skip to content

Conversation

RulaKhaled
Copy link
Member

Adds support for AnthropicAI manual instrumentation in @sentry/cloudflare and @sentry/vercel-edge.

To instrument the AnthropicAI client, wrap it with Sentry.instrumentAnthropicAiClient and set recording settings.

import * as Sentry from '@sentry/cloudflare';
import Anthropic from '@anthropic-ai/sdk';

const anthropic = new Anthropic();
const client = Sentry.instrumentAnthropicAiClient(anthropic, { recordInputs: true,
recordOutputs: true });

// use the wrapped client

cursor[bot]

This comment was marked as outdated.

Copy link
Contributor

github-actions bot commented Sep 9, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 24.17 kB - -
@sentry/browser - with treeshaking flags 22.75 kB - -
@sentry/browser (incl. Tracing) 40.17 kB - -
@sentry/browser (incl. Tracing, Replay) 78.52 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 68.28 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 83.2 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 95.41 kB - -
@sentry/browser (incl. Feedback) 40.91 kB - -
@sentry/browser (incl. sendFeedback) 28.82 kB - -
@sentry/browser (incl. FeedbackAsync) 33.77 kB - -
@sentry/react 25.89 kB - -
@sentry/react (incl. Tracing) 42.13 kB - -
@sentry/vue 28.66 kB - -
@sentry/vue (incl. Tracing) 41.97 kB - -
@sentry/svelte 24.2 kB - -
CDN Bundle 25.76 kB - -
CDN Bundle (incl. Tracing) 40.05 kB - -
CDN Bundle (incl. Tracing, Replay) 76.33 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 81.79 kB - -
CDN Bundle - uncompressed 75.33 kB - -
CDN Bundle (incl. Tracing) - uncompressed 118.56 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 233.66 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 246.42 kB - -
@sentry/nextjs (client) 44.17 kB - -
@sentry/sveltekit (client) 40.6 kB - -
@sentry/node-core 49.83 kB - -
@sentry/node 151.06 kB +0.01% +1 B 🔺
@sentry/node - without tracing 91.72 kB - -
@sentry/aws-serverless 105.17 kB +0.01% +1 B 🔺

View base workflow run

Copy link
Contributor

github-actions bot commented Sep 9, 2025

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 9,514 - 9,239 +3%
GET With Sentry 1,349 14% 1,275 +6%
GET With Sentry (error only) 6,199 65% 5,962 +4%
POST Baseline 1,090 - 1,206 -10%
POST With Sentry 496 46% 477 +4%
POST With Sentry (error only) 1,079 99% 1,070 +1%
MYSQL Baseline 3,377 - 3,302 +2%
MYSQL With Sentry 442 13% 406 +9%
MYSQL With Sentry (error only) 2,735 81% 2,660 +3%

View base workflow run

@RulaKhaled RulaKhaled merged commit 7f40621 into develop Sep 11, 2025
64 checks passed
@RulaKhaled RulaKhaled deleted the support-anthropic-ai-in-vercel-edge-and-cloudflare branch September 11, 2025 08:12
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.

2 participants