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.

1 Respuesta
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
EXPERTO
respondido hace 8 meses

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas