Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to track number of AWS Lambda error retry

Tags:

aws-lambda

In case of error or exception, Java AWS Lambda tries to re-invoke the function up to three times. Is there a way to keep track of the current invocation count, i.e. to know whether it is the first, second or third invocation? Thanks

like image 463
super7egazi Avatar asked Aug 22 '16 18:08

super7egazi


1 Answers

From my understanding there are no built in Metrics in CloudWatch that tracks this. One idea would be to log a timestamp with the parameters of the Lambda and then create a custom metric that checks for the same parameters being executed within a certain time interval.

That would not guarantee 100% accuracy, but it might provide a semi-accurate count of retries.

like image 134
Steven Muschler Avatar answered Nov 10 '22 01:11

Steven Muschler