1

AWS Lambda provides a CloudWatch/All Metrics/ Dashboard called "Error count and success rate (%)".

enter image description here

The link to this Dashboard is available from AWS Lambda/Dashboard/Error count and success rate (%)/View in metrics. Tip click the hamburger in the Error graph, top right.

Question: I am looking for the source of the Lambdas' error/s (there could be 1 or hundreds of functions) that contribute to the creation of the Errors?

Why: I need the list of Lambda functions that are throwing errors (for me they are typically timeouts), but these errors we want to track may change over time.

What I could do: I could create a specific CloudWatch rule for each Lambda function. This is not efficient as there maybe 100's +++ of functions. I could also use the CDLI however this is limited to a maximum of 20x CloudWatch Logs ie:

aws logs start-query --log-group-name /aws/lambda/lambdaFunction1020 --start-time 1646185910 --end-time 1646358710 --query-string 'fields @timestamp, @message | filter @message like "Task timed out" | sort @timestamp desc | limit 20'

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
jono2010
  • 602
  • 1
  • 7
  • 13

1 Answers1

0

The answer is in: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch-metrics-insights-buildquery.html

Go to: Cloudwatch/All Metrics/Query and use the following SQL. From what I can see there are no LIMITS on the number of results returned. The only issue I have found is the time frame is limited to a maximum of three (3) hours.

SELECT SUM(Errors)
FROM SCHEMA("AWS/Lambda", FunctionName)
GROUP BY FunctionName
ORDER BY SUM() DESC
LIMIT 10

There is also a number of pre-built queries under "Add query" for many AWS services...

jono2010
  • 602
  • 1
  • 7
  • 13