AWS X-Ray is a service that collects data about requests that your application serves, and provides tools you can use to view, filter, and gain insights into that data to identify issues and opportunities for optimization. For any traced request to your application, you can see detailed information not only about the request and response, but also about calls that your application makes to downstream AWS resources, microservices, databases and HTTP web APIs.
- You can run the X-Ray daemon on the following operating systems on Amazon EC2:
- Amazon Linux
- Ubuntu
Windows Server (2012 R2 and newer)
The X-Ray daemon must be running on the EC2 instance in order to collect data. You can use a user data script to run the daemon automatically when you launch the instance. The X-Ray daemon uses the AWS SDK to upload trace data to X-Ray, and it needs AWS credentials with permission to do that.
On Amazon EC2, the daemon uses the instance's instance profile role automatically. The IAM role or user that the daemon's credentials belong to must have permission to write data to the service on your behalf.
- To use the daemon on Amazon EC2, create a new instance profile role or add the managed policy to an existing one.
- To use the daemon on Elastic Beanstalk, add the managed policy to the Elastic Beanstalk default instance profile role.
- To run the daemon locally, create an IAM user and save its access keys on your computer.
Therefore, the most likely cause of the issues being experienced in this scenario is that the instance’s instance profile role does not have permission to upload trace data to X-Ray or the X-Ray daemon is not running on the EC2 instance.
CORRECT: "The instance’s instance profile role does not have permission to upload trace data to X-Ray" is the correct answer.
CORRECT: "The X-Ray daemon is not installed on the EC2 instance." is also a correct answer.
INCORRECT: "The X-Ray API is not installed on the EC2 instance " is incorrect as you do not install the X-Ray API, you run the X-Ray daemon. The API will always be accessible using the X-Ray endpoint.
INCORRECT: "The traces are reaching X-Ray, but the Developer does not have permission to view the records" is incorrect as the developer previously viewed data in X-Ray so clearly has permissions.
INCORRECT: "The X-Ray segments are being queued" is incorrect. The X-Ray daemon is responsible for relaying trace data to X-Ray. However, it will not queue data for an extended period of time so this is unlikely to be a cause of this issue.
References:
https://docs.aws.amazon.com/xray/latest/devguide/xray-daemon-ec2.html
https://docs.aws.amazon.com/xray/latest/devguide/xray-daemon.html
https://docs.aws.amazon.com/xray/latest/devguide/xray-daemon.html#xray-daemon-permissions
Save time with our AWS cheat sheets:
https://digitalcloud.training/aws-developer-tools/