-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
AWS SDK v3 Support (v2 deprecation) #8575
Comments
Hi @throrin19 thanks for writing in! Sounds like we can't upgrade to the v3 SDK at the moment without dropping support for Node <18 on AWS Lambda. So we can't do this without releasing a major and even then it partially goes against our philosophy of supporting old runtimes as long as possible. On the other hand, I get that this warning is concerning. I'm going to backlog this issue and add it to the "Up for Discussion" tasks for our next major. |
Thanks for your response and I fully understand this complex problem |
You don't need node 18. We are using the new SDK with node 16 and I'm pretty sure it works in node 14 and possibly even earlier versions. There's nothing special about their code P.S.: anyone that is using the old SDK is already receiving this:
|
According to the v3 docs, Node 14 is the minimum. But according to @throrin19,
Does this mean that v3 can only be used in Node 18 lambdas? I'm a bit confused by this and would appreciate some more insights. Furthermore, I'm not sure (and didn't find yet) what the minimum version of v2 was. Our overall goal must be that we maintain support for all Node versions we currently maintain until we drop support in the Next major (TBD). If it is possible to accomplish this with when updating to the v3 SDK we can do this. However, I can't guarantee any time frame, given that we're swamped with tasks and serverless is pretty low on our list of priorities. PRs are defiitely welcome here ;) Furthermore, we'll need to look at sentry-javascript/packages/serverless/src/awsservices.ts Lines 43 to 45 in 0b229bb
which patches a method of the AWS SDK. I don't know at the moment if this API changed in v3 and if/how we can patch both. Thanks for the help! |
@Lms24 According to AWS documentation, AWS SDK v2 is available directly in lambda default layer in node version <= node14. For node >= 18 it's AWS SDK v3. The problem is mainly in the optimization of the lambdas, and in particular the size of the lambdas. Basically, the serverless framework won't integrate aws-sdk packages into the final build if they correspond to those provided by the default layer of the node version. In our case, given that sentry-serverless uses sdk v2, if we decide to build on node <= 14, no worries, the sdk won't be included in the final code, we'll use the layer's sdk. On the other hand, if you decide to build on node >= 18, you'll have to integrate the sdk v2 code, as it's not provided by default. I don't know if I'm helping to clarify the problem. |
Any news about that ? Aws just launch node 20 compatibility with lambdas and, according to the documentation :
|
Hi, coming in with a few infos:
|
@lforst not quite sure what your contribution to this thread is. AWS SDK v2 is deprecated, AWS is asking people to move away from it. It's not even bundled anymore in the latest runtimes. The node 16 layer is the last one where it is and they are deprecating that layer in a few months. What's been asked here is for AWS SDK v3 support and not whether or not AWS SDK v2 support works. Of course if you don't use |
@alfaproject Skimming this issue I didn't read it as asking for AWS SDK v3 support. I corrected my previous comment. The comment was intended to inform people coming to this thread with questions about compatibility because it seemed like @throrin19 was concerned about bundle size and compatibility in his comments. As it stands aws sdk v3 support is currently not a big priority for us. |
@throrin19 I don't understand. Sentry does not pull in the AWS SDK v2. It merely uses it if it is available. You can use the SDK even though we don't officially support the AWS SDK v3 yet. You can use whatever node version you like with the Sentry SDK (as long as it's Node version >= 8). |
@ifost AWS SDK v2 is used by sentry and builded into lambda. After that we have the deprecation warning of AWS for this library. Addition size is not negligible : With lambda on node 18+ we can't ignore aws-sdk and import it directly in the code like we said in previous responses. I don't understand why you don't follow the specs shared by AWS and use unmaintained/deprecated library for next node versions |
@throrin19 Could you point me to the location in the SDK code where Sentry is pulling in the AWS SDK v2? I genuinely don't understand how this is a problem apart from not instrumenting the SDK v3. |
I think the problem load aws-sdk V2 in sentry is that line :
|
@throrin19 but that line doesn't pull in the SDK, it merely requires it. It shouldn't have any effect on lambda size as you mentioned. |
If I remove sentry call, I don't have aws SDK v2 in my builded files |
@throrin19 Ok, that means you have the AWS SDK v2 installed locally and your bundler is pulling it in. This is not something we can fix. |
you don't understand or don't want to understand: I don't have AWS SDK2 as a dependency in my project. the only time it gets added is when I use Sentry. so there is definitely a problem in your library which uses it in the background. This is what I have been pointing out for several months but you seem not to understand.....Le 11 déc. 2023 18:26, Luca Forstner ***@***.***> a écrit :
@throrin19 Ok, that means you have the AWS SDK v2 installed locally and your bundler is pulling it in. This is not something we can fix.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@throrin19 Feel free to share a reproduction example where the AWS SDK v2 is pulled in and we will take a look. |
I created a project with the example here : https://github.com/Aquassay/test-sentry-serverless-aws-sdk You can run analyze of a lambda with or without sentry to saw the difference. And the difference is like I said : with Sentry, we have an import of aws-sdk V2 by this code line :
This is the analyze without Sentry on the lambda (In my example, in TS with middy) : And the analyze with Sentry : |
@throrin19 In your esbuild config you neither marked |
I think you don't want understand....If you made it external, it's not included in the lambda.in node 18+, AWS SDK v2 is not included : we have error in usage if we called this.And sentry is never included with your response.
This occured with execution error.The solution is to push them inside a lambda layer but it's not a proper solution and it have a really big problem with the library for now
|
Will be released with |
Problem Statement
Actually,
@sentry/serverless
package use theaws-sdk
v2. It results on this warnings when testing in local with serverless-offline :With lambdas using the node18 runtime, the sdk available is the v3, not the v2. To be able to use the sdk in v2, it must be included in the package, which makes the size of each lambdas quite substantial.
Solution Brainstorm
Use the sdk v3. But, with that, we have the problem of compatibility between aws node runtime < node18 using the sdk v2 and aws node runtime >= node18 using the sdk v3
The text was updated successfully, but these errors were encountered: