Skip to content

Conversation

RulaKhaled
Copy link
Member

This PR enhances Anthropic AI instrumentation to properly handle and record errors that occur as part of response metadata.

Core Error Handling Improvements:

  • Enhanced error detection: Added proper handling for Anthropic API error responses with type: 'error' structure
  • Improved streaming error handling: Better error type detection and reporting for streaming operations
  • Error capturing: Manually captured errors for both standard and streaming errors

@RulaKhaled RulaKhaled self-assigned this Sep 5, 2025
Copy link
Contributor

github-actions bot commented Sep 5, 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.14 kB - -
@sentry/browser (incl. Tracing, Replay) 78.5 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 68.26 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 83.18 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 95.38 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.11 kB - -
@sentry/vue 28.66 kB - -
@sentry/vue (incl. Tracing) 41.95 kB - -
@sentry/svelte 24.2 kB - -
CDN Bundle 25.76 kB - -
CDN Bundle (incl. Tracing) 40.01 kB - -
CDN Bundle (incl. Tracing, Replay) 76.29 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 81.75 kB - -
CDN Bundle - uncompressed 75.2 kB - -
CDN Bundle (incl. Tracing) - uncompressed 118.31 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 233.4 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 246.16 kB - -
@sentry/nextjs (client) 44.14 kB - -
@sentry/sveltekit (client) 40.58 kB - -
@sentry/node-core 49.66 kB - -
@sentry/node 150.7 kB +0.03% +45 B 🔺
@sentry/node - without tracing 92.23 kB - -
@sentry/aws-serverless 105.53 kB - -

View base workflow run

Copy link
Contributor

github-actions bot commented Sep 5, 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,084 - 8,832 +3%
GET With Sentry 1,368 15% 1,325 +3%
GET With Sentry (error only) 5,986 66% 5,846 +2%
POST Baseline 1,209 - 1,193 +1%
POST With Sentry 496 41% 477 +4%
POST With Sentry (error only) 1,069 88% 1,055 +1%
MYSQL Baseline 3,357 - 3,306 +2%
MYSQL With Sentry 461 14% 435 +6%
MYSQL With Sentry (error only) 2,710 81% 2,702 +0%

View base workflow run

Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

Thanks a lot for setting the mechanism. I had two remarks but as I wrote, might be missing some context.

@RulaKhaled RulaKhaled merged commit 68fcc82 into develop Sep 5, 2025
188 checks passed
@RulaKhaled RulaKhaled deleted the record-errors branch September 5, 2025 19:27
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.

3 participants