A Lambda function processes messages from IoT devices. The company needs near-real-time throughput metrics that count how many messages the function receives and processes per time interval. Initialization and post-processing should not be included in the throughput measurement. What should the developer implement?
Choose an answer
Tap an option to check your answer.
Correct answer: Modify the code to publish a custom CloudWatch metric each time the function receives and processes a message, and use those metrics to compute throughput..
Why this is the answer
Publishing a custom CloudWatch metric within the Lambda function's core processing logic is the most precise way to measure throughput for the specific task of receiving and processing messages, excluding initialization and post-processing. This allows for granular control over what constitutes a "processed message." Using Lambda ConcurrentExecutions measures the number of concurrent executions, not the rate of processed messages. Logging throughput to CloudWatch Logs and using EventBridge is overly complex and less efficient than direct custom metrics for this purpose. While Lambda Invocations and Duration metrics can give an idea of overall function activity, they don't isolate the specific "receive and process" phase and might include initialization or cleanup time, making them less accurate for the required throughput measurement.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed