Soru

Zorluk: KolayInstrumenting Distributed Tracing with AWS X-Ray

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?

  1. Install and run the AWS X-Ray daemon on the EC2 instances.Cevap
  2. Attach an IAM role with the AWSXrayWriteOnlyAccess policy to the EC2 instances.Cevap
  3. C
    Configure the AWS SDK client in the code by hardcoding the credentials of an IAM user with X-Ray permissions.
  4. D
    Increase the visibility timeout of the Amazon SQS queue that triggers the application to allow enough time for tracing.
  5. E
    Configure Amazon API Gateway to use a Lambda custom integration to proxy the trace data to the EC2 instances.

Cevap

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.

Adım Adım Çözüm

1
Enable tracing daemon on the host.
The AWS X-Ray daemon is running on the EC2 instances, listening on UDP port 2000 for trace data sent by the SDK.
The X-Ray SDK sends trace segments to the daemon, which buffers and uploads them to the X-Ray service in batches.
2
Configure instance permissions.
An IAM role with the AWSXrayWriteOnlyAccess policy is attached to the EC2 instances.
The daemon running on the EC2 instances needs authorization to call the X-Ray API to write trace data.

Anahtar Kavram

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.
Tahmini Süre:1m 30s
Bu soruyu puanla