Sharpen your knowledge of the AWS Lambda Powertools observability utilities.
0 / 5 completed
1 / 5
During a code review, a dev wants structured JSON logs with correlation ids in Lambda. Which Powertools utility fits?
The Powertools Logger emits structured JSON logs and can inject context like the request id automatically. It supports log sampling and correlation ids for tracing requests across invocations. This is preferred over raw print for observability in Lambda.
2 / 5
In a design review, the team wants distributed traces to X-Ray. Which utility do they use?
The Powertools Tracer wraps handlers and functions to emit AWS X-Ray subsegments automatically. It captures cold starts, response metadata, and exceptions as trace annotations. This gives end-to-end visibility into a Lambda's execution path.
3 / 5
At standup, a dev wants custom business metrics emitted cheaply from Lambda. Which approach does Powertools use?
Powertools Metrics uses the CloudWatch EMF (Embedded Metric Format), embedding metrics inside log lines that CloudWatch parses asynchronously. This avoids costly synchronous PutMetricData API calls in the hot path. It scales efficiently for high-volume functions.
4 / 5
An incident report shows a payment Lambda charged a customer twice on a retry. Which utility prevents this?
The Powertools Idempotency utility persists a result keyed by a payload hash, so retries return the stored response instead of re-executing side effects. Backed by DynamoDB, it guards against duplicate processing during retries. This is exactly the fix for double-charging on retry.
5 / 5
During a PR review, a dev processes SQS records and wants partial-batch failure handling. Which utility helps?
The Powertools Batch Processing utility processes records from SQS, Kinesis, or DynamoDB streams and reports only the failed items back via batchItemFailures. This lets successful records be removed while only failures are retried. It prevents reprocessing an entire batch when one record fails.