Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create ESM Lambda Layer #12856

Open
9 tasks
Tracked by #12409
Lms24 opened this issue Jul 10, 2024 · 5 comments
Open
9 tasks
Tracked by #12409

Create ESM Lambda Layer #12856

Lms24 opened this issue Jul 10, 2024 · 5 comments
Assignees
Labels
Feature: Serverless Package: aws-serverless Issues related to the Sentry AWS Serverless SDK

Comments

@Lms24
Copy link
Member

Lms24 commented Jul 10, 2024

(extracted from #12409)

Since using the Sentry AWS Serverless SDK is far from easy in ESM-based Lambda functions, we should look into creating a layer for ESM or making our current layer compatible with both, CJS and ESM.

I outlined some of the prior investigation to this in #12322 and #12409.

One major blocker for a code-less Sentry SDK usage like in CJS is that our tryPatchHandler function we use to auto-wrap CJS lambda functions can't be applied to ESM Lambda functions (it uses require 😢). However, we can create a layer and tell people to manually init the SDK in code. Having the layer is still a huge improvement because users don't have to deploy their node_modules like when installing the SDK via NPM. h/t @andreiborza for pointing this out today!

ESM Layer v0 (no auto-wrapping)

Preview Give feedback

ESM layer v1 (auto-wrapping)

Preview Give feedback

Stretch Goals

Preview Give feedback
@Lms24
Copy link
Member Author

Lms24 commented Jul 10, 2024

Extracted this issue so we can link to it from docs that mention the ESM limitations around the layer

@paolostyle
Copy link

Is there any progress on this? Also I'd suggest implementing the integration using AWS Lambda Extensions, the issues mentioned in #3051 are very much present currently, Sentry adds a lot of overhead and it sounds like the Lambda Extensions is the solution to that.

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Sep 3, 2024
@Lms24
Copy link
Member Author

Lms24 commented Sep 3, 2024

Hi, no progress on this at the moment, as we're busy with a lot of other issues.

I'm gonna tag @andreiborza if you get some time or need a break from Solid(Start). I gotta admit I had no idea that #3051 was receiving replies (this issue predates almost everyone working on the team by now). The unfortunate thing is that this is a hard problem to solve.

IIRC there are some limitations to the Lambda Extension API why we can't use it but I'll ask around a bit.

@microadam
Copy link

@Lms24 would love to hear any issues you are aware of with the Lamba Extensions API, as having implemented this: #3051 (comment)

We are able to use sentry without the noticeable delay on a fairly high traffic system. Its probably far from perfect (better batching could be introduced for example and currently the data is sent on the NEXT lambda invocation). Any details would be great :) (or just a link to where any discussion on this might be taking place now / in the future so I could follow along!)

@andreiborza
Copy link
Member

Thanks @microadam, we'll revisit extensions and see if they're a viable path forward when working on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Serverless Package: aws-serverless Issues related to the Sentry AWS Serverless SDK
Projects
Status: No status
Development

No branches or pull requests

4 participants