Describe how you would monitor and troubleshoot AWS Lambda functions.
Instruction: Discuss the tools and techniques you would use to monitor the performance of AWS Lambda functions and identify how you would troubleshoot common issues.
Updated
Official answer
Start with the affected request, time window, function version and invocation source. Compare client/API latency, Lambda errors and throttles, function duration percentiles, concurrency and downstream latency. A successful invocation metric does not prove that the business operation succeeded, and Lambda Duration excludes cold-start initialization.
Use structured CloudWatch Logs with request/correlation IDs and bounded error context. Log delivery requires the appropriate execution-role permissions. Do not log credentials, authorization tokens or complete sensitive payloads. Correlate a slow request with initialization reports, memory use, timeouts and database or HTTP spans; use supported tracing instrumentation such as AWS Distro for OpenTelemetry where appropriate.
Diagnose from evidence: throttles suggest concurrency or source-specific limits; long dependency spans suggest downstream work; repeated initialization suggests a different cause from slow warm execution. Stream IteratorAge or queue age can expose a backlog even when the last invocation was fast. Check source retries before interpreting repeated logs as separate user actions.
Reproduce with a redacted event and the same runtime/configuration in a test environment. Change one suspected cause, compare equivalent workload distributions and verify error rates as well as latency. During an incident, prefer a tested alias rollback or bounded traffic reduction over an unverified code or capacity change.