Reputation: 773
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
Upvotes: 9
Views: 2524
Reputation: 51
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.
Upvotes: 1