I've followed the AWS documentation on setting up XRAY for our Spring Boot application deployed on AWS ECS, but I'm not able to see the traces for my services in the AWS Console. Here's a high level view of the changes I've implemented:
Added Role with Policy permissions to my EC2
"xray:BatchGetTraces",
"xray:GetServiceGraph",
"xray:GetTraceGraph",
"xray:GetTraceSummaries",
"xray:PutTelemetryRecords",
"xray:PutTraceSegments"
Added Tracing filter
@Bean
public Filter TracingFilter() {
return new AWSXRayServletFilter("myService");
}
Added XRAY dependencies to our POM file and added @XRayEnabled annotation to our Controller method:
Downloaded the XRAY Daemon to our ec2 instance and installed
curl https://s3.dualstack.us-east-1.amazonaws.com/aws-xray-assets.us-east-1/xray-daemon/aws-xray-daemon-3.x.rpm -o /home/ec2-user/xray.rpm
yum install -y /home/ec2-user/xray.rpm
I've verified that we are seeing UDP logging statements for example: com.amazonaws.xray.emitters.UDPEmitter:
{
"name" : "myService",
"id" : "1234",
"start_time" : 1.546020031234E9,
"trace_id" : "myTraceId",
"end_time" : 1.546020031234E9,
"http" : {
"request" : {
"method" : "POST",
"client_ip" : "myIp",
"url" : "myURL",
"user_agent" : "PostmanRuntime/7.4.0",
"x_forwarded_for" : true
},
"response" : {
"content_length" : 200,
"status" : 200
}
},
"aws" : {
"xray" : {
"sdk_version" : "1.2.1",
"sdk" : "X-Ray for Java"
}
},
"service" : {
"runtime" : "OpenJDK 64-Bit Server VM",
"runtime_version" : "1.8.0_151"
}
}
And I've also verified that the daemon is running on the ec2 using netstat -tulpn
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
udp 0 0 127.0.0.1:2000 0.0.0.0:* 14126/xray
What else is needed to be able to get the XRAY traces to show up in the AWS Console?
I've started the docker daemon with logging enabled, but I'm not seeing any indication that the docker daemon is sending data to AWS, just startup information and that's it:
2018-12-28T23:14:19Z [Info] Initializing AWS X-Ray daemon 3.0.0
2018-12-28T23:14:19Z [Info] Using buffer memory limit of 304 MB
2018-12-28T23:14:19Z [Info] 4864 segment buffers allocated
2018-12-28T23:14:19Z [Info] Using region: us-east-1
2018-12-28T23:14:19Z [Info] Starting proxy http server on 127.0.0.1:2000