Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Monitoring AWS Lambda errors

Tags:

aws-lambda

I want to view AWS lambda last hour errors of two types:

  • Lambda function that finished with an error
  • Lambda function returned http 500

How should I do that?

like image 296
Avi Zloof Avatar asked Jun 28 '17 07:06

Avi Zloof


Video Answer


2 Answers

NOTE: only if you use serverless:

Alternatively, you can monitor your lambda function logs using serverless cli.

For example, to get log in the past 1 hours:

sls logs -f functionName --startTime 1h

You also can filter based on the string 'error' in the past 1 hours:

sls logs -f functionName --startTime 1h --filter error

Please check on the doc.

like image 155
nitya wijayanti Avatar answered Jan 03 '23 17:01

nitya wijayanti


If you have many lambdas, in can be difficult to identify exactly which lambda caused an error. Here is how to find it out, even if you have hundreds of lambdas.

In CloudWatch, go to the Metrics page, then go to the Graph Metrics tab, then navigate to the dropdown menu item “Math expression > Search > Lambda Throttles or Errors.”

This will give you error counts per lambda in a graph, mouse over to get the name of the offending lambda.

like image 40
Rems Avatar answered Jan 03 '23 18:01

Rems