I want to use Node.js in AWS Lambda in production. The question is how to make this reliable.
For me, reliability means:
process.on('uncaughtException')
does not work So how can I implement 2 and 3 points?
One idea is using a SQS queue
as a Dead Letter Queue
, which can be set up for that lambda ( http://docs.aws.amazon.com/lambda/latest/dg/dlq.html ). So you can monitor that queue to analyze the inputs that made the function to fail and take some action.
For logging, you can use winston
( https://github.com/winstonjs/winston ). Works fine with AWS lambdas.
In your lambda workflow I guess you have some kind of error handler function where is anything happens, It ends there. You can use that error handler to send you emails with the event and context inputs and other error thingy descriptions.
Also you can monitor lambdas via cloudfront, and create an alarm that sends you certain data if somethign went wrong.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.