A developer has a Java application running on Amazon EC2 instances. The developer has instrumented the application code using the AWS X-Ray SDK to trace incoming HTTP requests and downstream AWS service calls. However, no trace data is appearing in the AWS X-Ray console. Which TWO actions must the developer take to ensure that trace data is successfully sent to AWS X-Ray?
- Install and run the AWS X-Ray daemon on the EC2 instances.Answer
- Attach an IAM role with the AWSXrayWriteOnlyAccess policy to the EC2 instances.Answer
- CConfigure the AWS SDK client in the code by hardcoding the credentials of an IAM user with X-Ray permissions.
- DIncrease the visibility timeout of the Amazon SQS queue that triggers the application to allow enough time for tracing.
- EConfigure Amazon API Gateway to use a Lambda custom integration to proxy the trace data to the EC2 instances.
Answer
To successfully send trace data to AWS X-Ray from Java applications on EC2, the developer must install and run the AWS X-Ray daemon on the EC2 instances and attach an IAM role with the AWSXrayWriteOnlyAccess policy to the EC2 instances.
For an application running on Amazon EC2 to send trace segments to AWS X-Ray, the X-Ray daemon must be installed and running on the EC2 instance to listen on UDP port 2000. Additionally, the instance must have permission to upload trace data, which is provided by attaching an IAM role with the AWSXrayWriteOnlyAccess policy to the EC2 instance.
Step-by-Step Solution
Key Concept
AWS X-Ray EC2 configuration requires both the X-Ray daemon running on the host and an IAM instance profile with write permissions to send trace segments to the X-Ray API.
Estimated Time:1m 30s