I have enabled xray loggin and can see the UDP packets being sent logs but seeing nothing in XRay service map or traces, I observed for more than 10 minutes, and sent multiple requests for each of those I used to see the logs from my spring-boot application:
In WebConfig.java
I have the following:
@Bean
public Filter TracingFilter() {
return new AWSXRayServletFilter("Scorekeep");
}
static {
AWSXRayRecorderBuilder builder = AWSXRayRecorderBuilder.standard().withPlugin(new EC2Plugin()).withPlugin(new ElasticBeanstalkPlugin());
URL ruleFile = WebConfig.class.getResource("/sampling-rules.json");
builder.withSamplingStrategy(new LocalizedSamplingStrategy(ruleFile));
AWSXRay.setGlobalRecorder(builder.build());
AWSXRay.beginSegment("Scorekeep-init");
AWSXRay.endSegment();
}
I enabled xray debugs logs seeing no error but still no traces.
UPDATE: I added "AWSXrayWriteOnlyAccess" role to the EC2 instance still the same issue is happening.
I noticed however in the begining of the springboot’s application log there were two logs:
CloudWatch Agent log configuration file not found at /opt/a ws/amazon-cloudwatch-agent/etc/log-config.json. Install the CloudWatch Agent on this instance to record log references in X-Ray.
and
com.amazonaws.xray.plugins.EC2Plugin plugin returned empty Log References. The recorder will not reflect the logs from this plugin.
UPDATE2: I have installed cloudwatch agent still seeing the same message in the log:
UPDATE3:
I checked the "/var/log/xray/xray.log" file:
there are some failures in sending data and the success, initially I had not attached the "AWSXrayWriteOnlyAccess" role, then I attached and restarted the application, probably it’s because of that, there are success logs , still nothing shows up in servicemap or traces
Here is the screenshot of servicemap , I have kept time range as 6 hours still nothing:
2
Answers
Finally after my last update and waiting for sometime when I filtered with 3 hours data and I could see the traces:
XRay Daemon has
NoCredentialProvider
error. Please check AWS doc, configure the creds for XRay Daemon correctly.