Skip to content

Conversation

msonnb
Copy link
Member

@msonnb msonnb commented Sep 3, 2025

This introduces a new experimental Sentry Lambda extension within the existing Sentry Lambda layer. Sentry events are being tunnelled through the extension, where they are then forwarded to Sentry.

Initial benchmarks using ApacheBench show a reduction in request processing time of around 26% (from 243ms to 180ms on average over 100 requests; function pre-warmed).

To enable it, set _experiments.enableLambdaExtension in your Sentry config like this:

Sentry.init({
  // ...other config
  dsn: "<YOUR_DSN>",
  _experiments: {
    enableLambdaExtension: true
  }
})

closes #12856
relates to #3051

@msonnb msonnb self-assigned this Sep 3, 2025
Copy link
Contributor

github-actions bot commented Sep 3, 2025

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

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.63 kB -0.01% -1 B 🔽
@sentry/node - without tracing 92.23 kB - -
@sentry/aws-serverless 105.56 kB +0.03% +25 B 🔺

View base workflow run

Copy link
Contributor

github-actions bot commented Sep 3, 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.
⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 8,952 - 9,286 -4%
GET With Sentry 1,275 14% 1,306 -2%
GET With Sentry (error only) 6,002 67% 6,017 -0%
POST Baseline 1,203 - 1,205 -0%
POST With Sentry 489 41% 492 -1%
POST With Sentry (error only) 1,056 88% 1,056 -
MYSQL Baseline 3,349 - 3,365 -0%
MYSQL With Sentry 558 17% 465 +20%
MYSQL With Sentry (error only) 2,750 82% 2,740 +0%

View base workflow run

@msonnb msonnb changed the title [wip] lambda extension feat(aws): Add AWS Lambda extension to tunnel events Sep 4, 2025
@msonnb msonnb changed the title feat(aws): Add AWS Lambda extension to tunnel events feat(aws): Add experimental AWS Lambda extension for tunnelling events Sep 4, 2025
@msonnb msonnb marked this pull request as ready for review September 5, 2025 06:54
@msonnb msonnb requested a review from andreiborza September 5, 2025 06:54
cursor[bot]

This comment was marked as outdated.

Copy link
Member

@andreiborza andreiborza left a comment

Choose a reason for hiding this comment

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

Nice work!

Copy link
Member

@andreiborza andreiborza left a comment

Choose a reason for hiding this comment

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

🚀 excited for this upgrade!

@msonnb msonnb merged commit e7beae6 into develop Sep 8, 2025
368 of 369 checks passed
@msonnb msonnb deleted the ms/aws-extension branch September 8, 2025 07:48
@github-actions github-actions bot mentioned this pull request Sep 9, 2025
13 tasks
@joshorr
Copy link

joshorr commented Sep 10, 2025

@msonnb Would this also work with lambdas that use the standard python runtime environment?

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.

Create ESM Lambda Layer
3 participants