A developer has enabled active tracing on an AWS Lambda function that uses the AWS SDK for Python (boto3) to write data to an Amazon DynamoDB table. Although the Lambda function's execution is traced, the downstream calls to DynamoDB are missing from the AWS X-Ray service map. Which action must the developer take to include the DynamoDB calls in the X-Ray trace?
- Instrument the AWS SDK by using the patch_all or patch function from the X-Ray SDK in the Lambda function code.Cevap
- BIncrease the Lambda function's timeout configuration to allow the service execution context to persist longer.
- CConfigure the API Gateway integration type to use Lambda Custom integration to pass raw request payloads.
- DIncrease the Amazon SQS visibility timeout to prevent messages from returning to the queue during tracing.
Cevap
Instrument the AWS SDK by using the patch_all or patch function from the X-Ray SDK in the Lambda function code.
The correct answer is to instrument the AWS SDK by using the patch_all or patch function from the X-Ray SDK in the Lambda function code. While enabling active tracing on the Lambda function configuration creates the parent trace segment, the AWS SDK client inside the code must be instrumented using the X-Ray SDK so that outgoing API calls to services like DynamoDB are recorded as subsegments.
Adım Adım Çözüm
Anahtar Kavram
AWS X-Ray SDK Instrumentation
Tahmini Süre:45s