A developer is building a worker application running on Amazon ECS with Fargate. The application polls an Amazon SQS queue for messages, downloads the referenced files from Amazon S3, and writes processing metadata to an Amazon DynamoDB table. The ECS task role has the AWSXRayDaemonWriteAccess IAM policy attached, and the X-Ray daemon runs as a sidecar container in the task definition. Although trace segments for S3 and DynamoDB calls are generated, they appear as separate, disconnected traces in the AWS X-Ray console, and the relationship between the SQS message producer and the worker application's processing activities is not correlated. Which two actions must the developer take to resolve this issue and achieve end-to-end distributed tracing?
- Extract the AWS X-Ray trace header from the SQS message system attributes in the worker application, and use the SDK to create a segment context using that header as the parent.Cevap
- Instrument the AWS SDK clients for S3 and DynamoDB within the worker application code using the AWS X-Ray SDK.Cevap
- CEnable active tracing in the configuration settings of the Amazon SQS queue in the AWS Management Console.
- DAttach the AWSXRayDaemonWriteAccess IAM policy to the ECS Task Execution Role instead of the ECS Task Role.
- EConfigure the SQS queue's visibility timeout to be shorter than the worker application's average message processing time.