Subdomain 1.4: Apply programming concepts
1.A team wants to detect when a scheduled Lambda-based ingestion job silently stops producing new records in its destination table, rather than only being alerted when the function throws an error. Which combination of practices addresses this need?
- A.Emit a custom CloudWatch metric for records processed per run and alarm when the metric drops below an expected threshold
- B.Increase the function's memory allocation so it has more headroom before approaching its configured execution timeout
- C.Wrap the business logic in a broad `try`/`except` block that logs any exception message before returning normally
- D.Reduce the function's reserved concurrency to one so only a single invocation can run across all scheduled triggers
Show answer & explanation
Correct answer: A — Emit a custom CloudWatch metric for records processed per run and alarm when the metric drops below an expected threshold
- A. A custom metric tracking records processed, with an alarm on it dropping below expectation, catches a job that succeeds while producing unexpectedly few records.
- B. Increasing memory can help memory-bound performance, but it does nothing to detect a job that completes successfully while silently under-producing records.
- C. Catching and logging exceptions surfaces real errors, but a job that runs successfully without throwing raises no exception for this pattern to catch.
- D. Limiting concurrency to one controls how many instances run simultaneously, with no bearing on detecting whether a completed run produced expected volume.