Closed IDUN-BogdanPi closed 9 months ago
You are making an asynchronous AWS SDK call. Unfortunately, X-Ray does not support async calls. That async call can be executed after the endSegment() code is called because it is done in another thread. When it is executed after the endSegment() code, we get a segment not found exception as the subsegment does not have anything with witch to attach.
Would you be able to move over to using Open Telemetry? They have solved this problem.
You are making an asynchronous AWS SDK call. Unfortunately, X-Ray does not support async calls. That async call can be executed after the endSegment() code is called because it is done in another thread. When it is executed after the endSegment() code, we get a segment not found exception as the subsegment does not have anything with witch to attach.
Would you be able to move over to using Open Telemetry? They have solved this problem.
Thank you for your reply! Yes, I will look into Open Telemetry. I think the AWS Documentation should be updated to reflect clearly what is and what is not supported with X-Ray.
Hello,
Is X-Ray compatible with the AWS Kinesis KCL 2.X Java?
I have a consumer, very similar to the one described in the AWS docs.
After adding X-Ray:
I get errors about missing segments:
I understand the problem is that Kinesis Consumer is started outside a Servlet context so no
parent
segment is present but I have not found a way to fix this.I have tried adding the
TracingInterceptor
to the individual clients but it doesnt seem to work.I also tried different ways of modifying the Scheduler to manually start a segment but noting seems to work:
This is my X-Ray configuration:
It was my understanding that when using
aws-xray-recorder-sdk-aws-sdk-v2-instrumentor
all Java v2 clients should be instrumented with traces automatically.it is also expected that a queue consumer would run outside of a servlet context.
Am I missing something?
Many thanks for your help and time!