Skip to content

feat(aws-serverless): Add lambda extension to npm package#20133

Merged
andreiborza merged 2 commits intodevelopfrom
ab/aws-extension
Apr 9, 2026
Merged

feat(aws-serverless): Add lambda extension to npm package#20133
andreiborza merged 2 commits intodevelopfrom
ab/aws-extension

Conversation

@andreiborza
Copy link
Copy Markdown
Member

@andreiborza andreiborza commented Apr 9, 2026

This PR adds the Lambda Extension as a build output to the npm package. It was previously only available through our Lambda layer but is useful for users that do not use the layer but would still like to use our extension.

To use the extension with container image lambdas, copy the extension files to your Docker image and set the tunnel option in your application. This requires the installation of @sentry/aws-serverless, regardless of which other Sentry SDK is used in your application.

RUN mkdir -p /opt/sentry-extension
COPY node_modules/@sentry/aws-serverless/build/lambda-extension/sentry-extension
/opt/extensions/sentry-extension
COPY node_modules/@sentry/aws-serverless/build/lambda-extension/index.mjs
/opt/sentry-extension/index.mjs
RUN chmod +x /opt/extensions/sentry-extension /opt/sentry-extension/index.mjs
Sentry.init({
  dsn: '__DSN__',
  tunnel: 'http://localhost:9000/envelope',
});

Closes: #20114

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Core

  • Support registerTool/registerResource/registerPrompt in MCP integration by betegon in #20071
  • Support embeddings in langchain by nicohrubec in #20017

Deps

  • Bump bundler plugins to 5.2.0 by chargome in #20122
  • Bump lodash.template from 4.5.0 to 4.18.1 by dependabot in #20085
  • Bump @xmldom/xmldom from 0.8.3 to 0.8.12 by dependabot in #20066

Other

  • (aws-serverless) Add lambda extension to npm package by andreiborza in #20133
  • (cloudflare) Support basic WorkerEntrypoint by JPeer264 in #19884
  • (core, node) Portable Express integration by isaacs in #19928
  • (deno) Add denoRuntimeMetricsIntegration by chargome in #20023
  • (node, bun) Enforce minimum collection interval in runtime metrics integrations by chargome in #20068
  • (react-router) Export sentryOnError by chargome in #20120

Bug Fixes 🐛

Core

  • Only attach flags context to error events by Lms24 in #20116
  • Replace regex with string check in stack parser to prevent main thread blocking by chargome in #20089
  • Set span.status to error when MCP tool returns JSON-RPC error response by betegon in #20082

Other

  • (angular) Bump TypeScript to ~6.0.0 in angular-21 E2E test app by andreiborza in #20134
  • (aws-serverless) Add timeout to _endSpan forceFlush to prevent Lambda hanging by logaretm in #20064
  • (cloudflare) Ensure every request instruments functions by JPeer264 in #20044
  • (gatsby) Fix errorHandler signature to match bundler-plugin-core API by JPeer264 in #20048

Internal Changes 🔧

Core

  • Do not emit spans for chats.create in google-genai by nicohrubec in #19990
  • Unify .do* span ops to gen_ai.generate_content by nicohrubec in #20074
  • Simplify addResponseAttributes in openai integration by nicohrubec in #20013
  • Extract shared endStreamSpan for AI integrations by nicohrubec in #20021
  • Remove provider-specific AI span attributes in favor of gen_ai attributes in sentry conventions by nicohrubec in #20011

Deps

  • Bump mshick/add-pr-comment from dd126dd8c253650d181ad9538d8b4fa218fc31e8 to e7516d74559b5514092f5b096ed29a629a1237c6 by dependabot in #20078
  • Bump getsentry/craft/.github/workflows/changelog-preview.yml from 2.24.1 to 2.25.2 by dependabot in #20081

Other

  • (node) Add node integration tests for Vercel ToolLoopAgent by nicohrubec in #20087
  • (nuxt) Make Nuxt 5 (nightly) E2E optional by s1gr1d in #20113
  • (oxlint) Add typeawareness into oxlintrc by JPeer264 in #20075
  • Update validate-pr workflow by stephanie-anderson in #20072
  • Remove unused tsconfig-template folder by mydea in #20067

🤖 This preview updates automatically when you update the PR.

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit fb9a438. Configure here.

This PR adds the Lambda Extension as a build output to the npm package. It was
previously only available through our Lambda layer but is useful for users that
do not use the layer but would still like to use our extension.

To use the extension with container image lambdas, copy the extension files to
your Docker image and set the `tunnel` option in your application. This requires
the installation of `@sentry/aws-serverless`, regardless of which other Sentry
SDK is used in your application.

```dockerfile
    RUN mkdir -p /opt/sentry-extension
    COPY node_modules/@sentry/aws-serverless/build/lambda-extension/sentry-extension
  /opt/extensions/sentry-extension
    COPY node_modules/@sentry/aws-serverless/build/lambda-extension/index.mjs
  /opt/sentry-extension/index.mjs
    RUN chmod +x /opt/extensions/sentry-extension /opt/sentry-extension/index.mjs
```

```js
  Sentry.init({
    dsn: '__DSN__',
    tunnel: 'http://localhost:9000/envelope',
  });
```

Closes: #20114
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

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 25.64 kB - -
@sentry/browser - with treeshaking flags 24.13 kB - -
@sentry/browser (incl. Tracing) 42.15 kB - -
@sentry/browser (incl. Tracing, Profiling) 46.77 kB - -
@sentry/browser (incl. Tracing, Replay) 80.94 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 70.56 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 85.65 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 97.91 kB - -
@sentry/browser (incl. Feedback) 42.42 kB - -
@sentry/browser (incl. sendFeedback) 30.31 kB - -
@sentry/browser (incl. FeedbackAsync) 35.3 kB - -
@sentry/browser (incl. Metrics) 26.95 kB - -
@sentry/browser (incl. Logs) 27.1 kB - -
@sentry/browser (incl. Metrics & Logs) 27.78 kB - -
@sentry/react 27.41 kB - -
@sentry/react (incl. Tracing) 44.48 kB - -
@sentry/vue 30.08 kB - -
@sentry/vue (incl. Tracing) 44.05 kB - -
@sentry/svelte 25.67 kB - -
CDN Bundle 28.32 kB - -
CDN Bundle (incl. Tracing) 43.12 kB - -
CDN Bundle (incl. Logs, Metrics) 29.69 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 44.17 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 68.49 kB - -
CDN Bundle (incl. Tracing, Replay) 80.01 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 81.06 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 85.55 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 86.59 kB - -
CDN Bundle - uncompressed 82.72 kB - -
CDN Bundle (incl. Tracing) - uncompressed 127.86 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 86.86 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 131.27 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 209.84 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 244.74 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 248.13 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 257.65 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 261.04 kB - -
@sentry/nextjs (client) 46.89 kB - -
@sentry/sveltekit (client) 42.62 kB - -
@sentry/node-core 55.76 kB +0.02% +10 B 🔺
@sentry/node 172.41 kB +0.01% +13 B 🔺
@sentry/node - without tracing 96.04 kB +0.01% +5 B 🔺
@sentry/aws-serverless 112.85 kB +0.01% +6 B 🔺

View base workflow run

Comment on lines +9 to +11
if (!fs.existsSync(targetDir)) {
fs.mkdirSync(targetDir, { recursive: true });
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

l: we could just do fs.mkdirSync(targetDir, { recursive: true }); without the guard

@andreiborza andreiborza merged commit 4c14d78 into develop Apr 9, 2026
46 checks passed
@andreiborza andreiborza deleted the ab/aws-extension branch April 9, 2026 11:36
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.

Support Sentry Lambda Extension with container image-based Lambda functions

2 participants