Receive notifications when AWS Lambda timesout

Is there a way to get notifications when AWS Lambda is turned off?

I can not find any documentation. The only way for now is to search Cloudwatch logs for timeout notifications of all the Lambda features that I have. Is there a better way?

+4
source share
3 answers

You can force CloudWatch to trigger an alarm when a specific message appears in the logs. I can’t find the official documentation on this, but you create a “metric filter” in CloudWatch logs, and then you can create an alarm from this. This blog post seems to describe the process well.

+1
source

You can check inside the function how many milliseconds are left, and if your function is pending, send a notification from there.

From the docs:

context.getRemainingTimeInMillis ()

( -) , . - - . , AWS Lambda -.

, .

0

docs, . (, 0,5). CloudWatch > 0 ( >= 1).

- REPORT

Task timed out after 25.00 seconds

Cloudwatch.

0

Source: https://habr.com/ru/post/1629956/


All Articles