< Back
Runbook: CloudWatch Alarm observing the AWS/Lambda Errors metric
Lambda reports the Errors
metric to CloudWatch. The metric counts the number of errors during Lambda function executions.
Errors can be caused by:
- Execution timeout: Executions run longer than the configured timeout
- Out of memory: Executions need more memory than configured
- Handled errors: Errors the code reports back to Lambda on purpose
- Unhandled errors: Such as runtime exceptions or other errors in the code
Runbook
A step by step guide to reacting to a CloudWatch Alarm observing the AWS/Lambda
Errors
metric.
Errors greater than 0
Are you reading this runbook in Slack? If yes, proceed to step 1. If not:
a. Go to the Logs page of the CloudWatch service in the AWS Management Console
b. Click on the log group /aws/lambda/<Your Lambda Function Name>
c. Hit the blue Search Log Group button
d. Proceed to step 2.
- Follow the Logs Quick Link to access the logs of the errored Lambda function.
- Search for
"Task timed out after"
. If no results appear, proceed to step 3. Otherwise, your function executed longer than the configured timeout. You might want to increase the function timeout (up to 15 minutes). End of runbook. - Search for
"Process exited before completing request"
. If no results appear, proceed to step 4. Otherwise:
a. Click on the stream link on the right to a result.
b. Check the line before “Process exited before completing request” says “Duration: xxx ms Billed Duration: xxx ms Memory Size: xxx MB Max Memory Used: xxx MB”.
c. Does Memory Size equal Max Memory Used? If yes, your function consumed more memory than the maximum you configured. You might want to increase the function memory (up to 3008 MB). End of runbook. - Search for
?error ?exception ?failure
. If no results appear, proceed to step 5. Otherwise, there is probably an error in your code. End of runbook. - Clear the search query. Can you see a stack trace in your log by scrolling trough the logs? If not, proceed to step 6. If yes, there is probably an error in your code. End of runbook.
- You are running into an unknown error. End of runbook.
Chatbot for AWS Monitoring
Configure monitoring for Amazon Web Services: CloudWatch, EC2, RDS, EB, Lambda, and more. Receive and manage alerts via Slack. Solve incidents as a team.
Add to Slack
Add to Teams