Explore the essentials of monitoring Lambda functions using CloudWatch metrics, logs, and alarms. This quiz helps reinforce key concepts and practical scenarios for effective Lambda performance and troubleshooting insights.
Which metric would you primarily monitor in CloudWatch to track how many times a Lambda function is invoked?
Explanation: The 'Invocations' metric shows how often the Lambda function is called, making it the best choice for tracking invocation frequency. 'Duration' measures execution time, while 'Errors' counts failed executions and 'Timeouts' are not a direct metric but a type of error. Monitoring invocations helps you understand usage patterns and function demand.
What metric in CloudWatch is most useful for identifying delays caused by Lambda cold starts?
Explanation: The 'Duration' metric includes the time it takes to initialize a function, so spikes can indicate cold starts. 'BilledDuration' is related but primarily covers billing purposes. 'Throttles' counts throttling events, not time delays. 'ConcurrentExecutions' tracks how many Lambda instances are running in parallel, unrelated to startup delay.
If you want to receive a notification when a Lambda function returns errors more than five times in five minutes, what CloudWatch feature should you use?
Explanation: An 'Alarm' allows you to set conditions on metrics such as error counts and receive notifications when thresholds are exceeded. A 'Dashboard' displays visual data but doesn't trigger alerts. 'Log Group' is for logs, and a 'Filter' is used to search logs, not for direct notifications on metric changes.
Which CloudWatch metric reflects the number of times a Lambda function call was not executed due to reaching its concurrency limit?
Explanation: 'Throttles' records instances where requests are denied because the function has hit its concurrency limit. 'Errors' captures runtime problems, but not specifically throttling. 'Invocations' counts calls, not those denied. 'LogEvents' is not a Lambda metric and does not relate to execution limits.
Which metric in CloudWatch should you monitor to analyze how long your Lambda function executes for each run?
Explanation: 'Duration' shows the execution time in milliseconds for each run, providing insights into performance. 'Invocations' counts total runs, not execution time. 'Errors' logs unsuccessful usage, unrelated to timing. 'DeadLetterErrors' concerns the failure of event delivery to a secondary destination, not function duration.
When troubleshooting a failed Lambda function in CloudWatch, which resource contains the output of print statements from your function code?
Explanation: A 'Log Group' stores all log streams for a Lambda, including print statement outputs and other log events. 'Alarm' and 'Dashboard' display metrics and do not hold logs. 'Metric' shows numerical data but not the actual output of code-based logs.
Which CloudWatch metric would best help identify if your Lambda function is being executed concurrently at a high rate?
Explanation: 'ConcurrentExecutions' directly measures how many function instances run simultaneously, helping spot spikes in usage. 'Duration' tracks execution length but not concurrency. 'BilledDuration' relates to billing for runtime. 'DeadLetterErrors' tracks issues sending failed events elsewhere and does not indicate high concurrent use.
Which metric helps monitor how often Lambda events fail to be delivered to a destination configured as a dead letter queue?
Explanation: 'DeadLetterErrors' counts events that could not be sent to a dead letter queue, highlighting delivery issues. 'Throttles' relates to concurrency limits, not delivery failures. 'Errors' is a broader term and doesn't specify problems with dead letter destinations. 'Invocations' tracks function calls, not outbound errors.
If you want to monitor the number of successful database updates triggered by your Lambda, what logging option should you use with CloudWatch?
Explanation: 'Custom Metric' lets you track specific application data such as successful database updates by publishing custom data to monitoring. 'Error Metric' is not a distinct logging term. 'Log Group' is for collecting logs, not tracking specific application counts. 'Standard Metric' refers to default operational metrics, not custom data.
Which CloudWatch feature would you use to view and compare Lambda metrics and logs together over the last week?
Explanation: A 'Dashboard' can display multiple metrics and visual summaries in one place, aiding side-by-side analysis over custom time ranges. An 'Alarm' is for notifications, not comparison. The 'Monitoring Tab' is a popular term but refers to a general viewing area, not a CloudWatch feature. 'Alert' is not the name of a CloudWatch feature.