What should the developer do to perform the monitoring?
Configure the X-Ray SDK sampling rule and target. Activate the X-Ray daemon from the EC2 console or the AWS CLI with the modify-instance-attribute command to set the XRayEnabled flag.
Install the X-Ray daemon. Assign an IAM role to the EC2 instance with a policy that allows writes to X-Ray.
Install the X-Ray daemon. Configure it to forward data to Amazon EventBridge (Amazon CloudWatch Events). Grant the EC2 instance permission to write to Event Bridge (CloudWatch Events).
Deploy the X-Ray SDK with the application, and instrument the application code. Use the SDK logger to capture and send the events.
Explanations:
The X-Ray daemon must be installed and configured, but modifying the instance’s attributes and setting the X-RayEnabled flag is not a correct approach for enabling X-Ray monitoring. The daemon itself is responsible for sending data to X-Ray, not instance attributes.
The X-Ray daemon needs to be installed on the EC2 instance to collect and send trace data to X-Ray. Additionally, assigning an IAM role with appropriate permissions (write access to X-Ray) is necessary for the daemon to send data.
The X-Ray daemon does not forward data to EventBridge (CloudWatch Events). It forwards data to X-Ray service. Configuring EventBridge is unnecessary and not part of the correct setup for X-Ray monitoring.
While the SDK must be deployed with the application and the code needs to be instrumented, this option omits the necessary step of installing the X-Ray daemon, which is responsible for sending data to the X-Ray service.