A developer has enabled active tracing on an AWS Lambda function that processes incoming requests and writes data to an Amazon DynamoDB table. When viewing the traces in AWS X-Ray, the developer can see the Lambda function segment, but the downstream calls to DynamoDB are missing from the trace map. Which action 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
- BIncrease the execution timeout of the Lambda function to allow more time for tracing packets to be sent to X-Ray.
- CChange the API Gateway integration type from Lambda Proxy integration to Lambda Custom integration.
- DInitialize the DynamoDB client by hardcoding AWS access keys with permissions to write to X-Ray.
Cevap
Instrument the AWS SDK client in the Lambda function code using the AWS X-Ray SDK.
To record downstream calls to AWS services, the application code must use the AWS X-Ray SDK to wrap or instrument the AWS SDK client. For example, in Node.js, this is done by wrapping the AWS SDK with AWSXRay.captureAWS(require('aws-sdk')), or using the AWS X-Ray SDK for Java or Python equivalent. This ensures that the tracing context is propagated and downstream subsegments are created.
Adım Adım Çözüm
Anahtar Kavram
AWS X-Ray SDK instrumentation for downstream AWS SDK calls