A developer has enabled active tracing on an AWS Lambda function that is triggered by an Amazon SQS queue. The Lambda function processes the messages and writes the results to an Amazon DynamoDB table. While reviewing the trace map in the AWS X-Ray console, the developer observes that the Lambda function execution is traced, but the downstream calls to DynamoDB do not appear in the traces. Which of the following actions should the developer take to resolve this issue?
- Instrument the AWS SDK client in the Lambda function code using the AWS X-Ray SDK.Cevap
- BInitialize the AWS SDK client by hardcoding the AWS access key and secret access key in the function code.
- CIncrease the Lambda function execution timeout to match the visibility timeout of the Amazon SQS queue.
- DChange the API Gateway integration type to use Lambda Proxy integration.
Cevap
Instrument the AWS SDK client in the Lambda function code using the AWS X-Ray SDK.
The correct answer is to instrument the AWS SDK client using the AWS X-Ray SDK. Enabling active tracing on Lambda only configures the Lambda service to trace the function execution. To trace downstream HTTP/HTTPS calls to services like DynamoDB, the AWS SDK client within the function code must be wrapped or patched by the AWS X-Ray SDK.
Adım Adım Çözüm
Anahtar Kavram
AWS SDK Instrumentation for AWS X-Ray