Lambda Layer Modifications
Understand how the Sentry AWS Lambda integration works under the hood.
When Sentry is added to a Lambda function, the following modifications are made to your Lambda functions:
The layer for Sentry is added to your Lambdas. Any existing layers are honored and the Sentry layer is appended to the end.
Sentry adds the following environment variables
NODE_OPTIONS
: This is to preload theawslambda-auto
module which will automatically initialize SentrySENTRY_DSN
: This is set to the DSN of your projectSENTRY_TRACES_SAMPLE_RATE
: This sets the sampling rate for transactions. You can manually edit your environment variables if you want a different sampling rate.
When Sentry is added to a Lambda function, the following modifications are made to your Lambda functions:
The layer for Sentry is added to your Lambdas. Any existing layers are honored and the Sentry layer is appended to the end.
And your Runtime handler will point to Sentry's handler that will initialize the SDK for you, and then call your Runtime handler to invoke your function
Sentry adds the following environment variables
SENTRY_INITIAL_HANDLER
: This stores the value of your Runtime handler. If you choose to disable the Sentry layer, this value will be used to set the Runtime handler.SENTRY_DSN
: This is set to the DSN of your projectSENTRY_TRACES_SAMPLE_RATE
: This sets the sampling rate for transactions. You can manually edit your environment variables if you want a different sampling rate.
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").