Lambda only sporadically logs to cloudwatch and publishes events

0

I've seen a pattern in one of our lambdas where sometimes the lambda just doesn't log to cloudwatch or publish its events to eventbridge. The lambda seems to otherwise be executing fine--the expected changes to the database are always made--but sometimes there just aren't any associated cloudwatch logs or events. I have no idea what could be causing this so I was wondering if you guys can think of anything which would result in this behavior.

bill
已提問 8 個月前檢視次數 306 次
1 個回答
0

Hi, I guess that you're speaking of logs written by your own code (not those written by lambda runtime). In that case, I would create a CloudTrail track to locate all calls to CW APIs by your Lambda and see if they are all present (by comparing to the Lambda invocation unique ids).

If calls to CW match Lambda invocations, then it may be an issue with CW itself for which more investigation will be needed. Otherwise, it's the application code that may not handle CW logging properly.

Additionally, I'd sugggest to mirror the calls to CW with equivalent messages in a SQS queue to see if they match

Best,

Didier

profile pictureAWS
專家
已回答 8 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南