Skip to content

[v9] Improve version check for node lambda layer #82646

@andreiborza

Description

@andreiborza

Description

With the v8 major of the sentry-javascript SDKs, we introduced a version check for node lambda layers to use the correct package when setting NODE_OPTIONS.

With the v8 major we also started publishing a second node layer named SentryNodeServerlessSDKv7 which is a practice we are continuing withe the upcoming v9 major.

Problem

The current check doesn't consider which layer is active. If users use one of the newly published major layers (with lower ARN version numbers, e.g. arn:...:SentryNodeServerlessSDKv8:4 the check falsely detects the what SDK package should be used for the NODE_OPTIONS.

Solution Brainstorming

We should also check the layer's name in addition to the ARN version:

  • SentryNodeServerlessSDKv7 should set "NODE_OPTIONS": "-r @sentry/serverless/dist/awslambda-auto"
  • SentryNodeServerlessSDK and ARN version <= 235 should set "NODE_OPTIONS": "-r @sentry/serverless/dist/awslambda-auto"
  • Any other layer should use "NODE_OPTIONS": "-r @sentry/aws-serverless/awslambda-auto"

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions