feat(aws-serverless): Add lambda extension to npm package#20133
feat(aws-serverless): Add lambda extension to npm package#20133andreiborza merged 2 commits intodevelopfrom
Conversation
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Core
Deps
Other
Bug Fixes 🐛Core
Other
Internal Changes 🔧Core
Deps
Other
🤖 This preview updates automatically when you update the PR. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ 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.
fb9a438 to
e8ad881
Compare
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
e8ad881 to
dce0fae
Compare
size-limit report 📦
|
| if (!fs.existsSync(targetDir)) { | ||
| fs.mkdirSync(targetDir, { recursive: true }); | ||
| } |
There was a problem hiding this comment.
l: we could just do fs.mkdirSync(targetDir, { recursive: true }); without the guard

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
tunneloption in your application. This requires the installation of@sentry/aws-serverless, regardless of which other Sentry SDK is used in your application.Closes: #20114