Skill 4.3.9
Use application logs to identify performance bottlenecks
Key Concepts
Lambda's REPORT lines provide duration, init duration and memory used for every invocation, and CloudWatch Logs Insights can aggregate them, for example stats avg(@duration), max(@duration), pct(@duration, 99) by bin(5m) to spot slow periods, or filter for @initDuration to measure cold starts.
Applications can log their own timings for key steps, such as database queries and external calls, in structured JSON so Logs Insights can aggregate them by operation. API Gateway access logs record latency per request, and ELB access logs show request processing times for each target.