Search code examples
c#amazon-web-servicesaws-lambdaamazon-cloudwatchlogs

What would cause AWS Lambda not to write to Cloudwatch?


I have a simple AWS Lambda function that runs but does not always write to the cloudwatch log.

I've added a counter to the function to track when it logs and when it doesn't and can see that most of the time the first invocation is not recorded, but subsequent ones are (the counter starts at 0, so below is the result of me invoking the function for the second time:

enter image description here

I assumed that it was something that I was doing in code but got this result where the "START RequestId" entry was missing (yes I have hit the top retry link):

enter image description here

As far as I know there is absolutely nothing that I can do to stop the AWS infrastructure from recording the start and end of a request as this gets managed outside of my code. The code also runs and returns correctly, but it just doesn't always create a log, and other times doesn't create a whole log.

The only real difference to this from existing lambdas is that I am calling this from a Lambda Function Url.

Any ideas on why I'm seeing this and how to resolve? I'm pretty certain that its not a coding issue.


Solution

  • With no code changes the logs seem to be working, so I can only guess that it was some kind of system error within AWS that went on for some time.