AWS Lambda Container Image (Node)
As an alternative setup method, you can add Sentry to your Container Image. To import Sentry's Layer Image, add the following to your Dockerfile:
COPY /opt/ /opt
VERSION with a specific version number (for example, 28). You can see a complete list of available versions in Sentry's Amazon ECR repository.
Set the following environment variables in AWS:
SENTRY_DSNto your Sentry's DSN
SENTRY_TRACES_SAMPLE_RATEto your preferred sampling rate for transactions
Alternatively, you can also set the environment variables in the Dockerfile:
ENV NODE_OPTIONS="-r @sentry/serverless/dist/awslambda-auto"
The values you set in AWS override the value in the Dockerfile if both are set.