Posted On: Nov 8, 2023
AWS Lambda now makes it easy to monitor and troubleshoot Lambda function failures by reporting errors and timeouts during initialization and restore phases of the Lambda function lifecycle to Amazon CloudWatch Logs.
Lambda automatically captures and sends logs about each phase of the Lambda execution environment lifecycle to CloudWatch Logs. This includes the Init phase in which Lambda initializes the Lambda runtime and static code outside the function handler, Restore phase in which Lambda restores the execution environment from a snapshot for Lambda Snapstart-enabled functions, and Invoke phase in which Lambda executes the code in your function handler. Previously, Lambda only reported errors and timeout during the Invoke phase. With this launch, if an error or timeout occurs during the Init or Restore phase, Lambda sends log messages containing error or timeout details to CloudWatch Logs. This makes it easy for you to more effectively monitor and troubleshoot failures that occur during every phase of the Lambda function lifecycle.
You can view the new error and timeout log messages for your Lambda functions in the Monitor tab in Lambda console or the CloudWatch console. You can also use the AWS Command Line Interface (AWS CLI) or CloudWatch API to view the new error and timeout log messages. To learn more, visit the AWS Lambda Developer Guide.
The new error and timeout log messages are now available in all commercial regions where AWS Lambda is available, including the AWS GovCloud (US) Regions. For more information, see the AWS Region table.