Lambda cost and memory tracking

The key behind designing cost-effective serverless applications in AWS Lambda is by monitoring your cost and resource usage. Unfortunately, CloudWatch doesn't provide out of the box metrics about the resource usage or the Lambda function cost. Luckily, for each execution, the Lambda function writes an execution log to CloudWatch that looks like the following:

REPORT RequestId: 147e72f8-5143-11e8-bba3-b5140c3dea53 Duration: 12.00 ms Billed Duration: 100 ms  Memory Size: 128 MB Max Memory Used: 21 MB 

The preceding log shows the memory that's allocated and used for a given request. Those values can be extracted with a simple CloudWatch log metric filter. This feature enables you to search for specific keywords ...

Get Hands-On Serverless Applications with Go now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.