Skip to content

Conversation

RulaKhaled
Copy link
Member

This PR adds official support for instrumenting Anthropic AI SDK calls in Node with Sentry tracing, following OpenTelemetry semantic conventions for Generative AI.

We instrument the following Anthropic AI SDK methods:

  • messages.create
  • messages.countTokens
  • models.get
  • models.retrieve
  • completions.create

Supported in:

  • Node.js (ESM and CJS)
  • Will be added to cloudflare workers and vercel edge functions exports.

The anthropicAIIntegration() accepts the following options:

// The integration respects your sendDefaultPii client option
interface AnthropicAiOptions {
  recordInputs?: boolean;   // Whether to record prompt messages
  recordOutputs?: boolean;  // Whether to record response text
}

@RulaKhaled RulaKhaled force-pushed the anthropic-integration branch from 11ee820 to f88aef1 Compare August 7, 2025 11:58
Copy link
Contributor

github-actions bot commented Aug 7, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 24.16 kB - -
@sentry/browser - with treeshaking flags 22.73 kB - -
@sentry/browser (incl. Tracing) 39.87 kB - -
@sentry/browser (incl. Tracing, Replay) 77.99 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 67.83 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 82.69 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 94.79 kB - -
@sentry/browser (incl. Feedback) 40.83 kB - -
@sentry/browser (incl. sendFeedback) 28.81 kB - -
@sentry/browser (incl. FeedbackAsync) 33.7 kB - -
@sentry/react 25.88 kB - -
@sentry/react (incl. Tracing) 41.86 kB - -
@sentry/vue 28.64 kB - -
@sentry/vue (incl. Tracing) 41.69 kB - -
@sentry/svelte 24.18 kB - -
CDN Bundle 25.66 kB - -
CDN Bundle (incl. Tracing) 39.76 kB - -
CDN Bundle (incl. Tracing, Replay) 75.82 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 81.27 kB - -
CDN Bundle - uncompressed 74.96 kB - -
CDN Bundle (incl. Tracing) - uncompressed 117.59 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 231.88 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 244.48 kB - -
@sentry/nextjs (client) 43.89 kB - -
@sentry/sveltekit (client) 40.32 kB - -
@sentry/node-core 47.99 kB +0.01% +1 B 🔺
@sentry/node 148.42 kB +0.76% +1.11 kB 🔺
@sentry/node - without tracing 92.24 kB - -
@sentry/aws-serverless 104.46 kB +0.01% +2 B 🔺

View base workflow run

@RulaKhaled RulaKhaled force-pushed the anthropic-integration branch from 59dda8c to 7feef93 Compare August 7, 2025 12:09
@RulaKhaled RulaKhaled marked this pull request as ready for review August 11, 2025 07:36
cursor[bot]

This comment was marked as outdated.

@RulaKhaled RulaKhaled force-pushed the anthropic-integration branch from 77ee440 to fdb0059 Compare August 11, 2025 13:31
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@RulaKhaled RulaKhaled enabled auto-merge (squash) August 25, 2025 09:24
@RulaKhaled RulaKhaled disabled auto-merge August 25, 2025 09:24
cursor[bot]

This comment was marked as outdated.

@RulaKhaled RulaKhaled force-pushed the anthropic-integration branch from dadb2d6 to 4a4c2ea Compare August 25, 2025 19:11
@RulaKhaled RulaKhaled merged commit 444bd82 into develop Aug 25, 2025
184 checks passed
@RulaKhaled RulaKhaled deleted the anthropic-integration branch August 25, 2025 19:48
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