Open ecerulm opened 6 years ago
I found a workaround that I described at https://stackoverflow.com/a/49280254/90580
Basically since it's possible to provide my own client instances of AmazonKinesis
, AmazonCloudWatch
and AmazonDynamoDB
via Worker.Builder.kinesisClient(myClient)
, etc the problem is solved by adding a request handler to each of those client that invokes AWSXRay.beginSegment()
.
So
final AmazonDynamoDB dynamoDBClient = AmazonDynamoDBClientBuilder
.standard()
.withRequestHandlers(new XRayTracingHandler("my-segment-listener"))
.build();
where XRayTracingHandler is a custom class extending the Amazon's TracingHandler in which the beforeRequest()
and afterResponse()
are overrident to call beginSegment()
and endSegment()
@zeynepsu , can you comment on how is this completed?
Hello @ecerulm, I have added natively supporting X-Ray to our internal backlog and closed this issue since you mentioned you found a workaround. I can keep open and update this issue when we support X-Ray natively if that is something you are still interested in.
I can keep open and update this issue when we support X-Ray natively if that is something you are still interested in.
@zeynepsu , yes, please, that would be great.
Is there any update on this issue or any timeline on the native support for Kinesis with X-Ray?
I was trying to use KCL on a project where I have aws-xray-recorder-sdk-aws-sdk-instrumentor ,
KCL is raising SegmentNotFoundExceptions which I realized is because KCL is using it's own threads which is fine.
I thought I could just provide my own ExecutorService with
new Worker.Builder().executorService(myExecutorServer).build()
and call AWSXRay.beginSegment() before each Runnable but when I did I realized that there are other ExecutorServices that I can't customize. For example, LeaseCoordinator starts yet another.So I think now it's not possible to use AWS X-Ray together with KCL, I mean I can just disable X-Ray globally and call
addTracingHandler()
for the other amazon clients I'm using. But then the work that KCL is doing won't be traced by X-Ray.In my case
AWS_TRACING_NAME
is not a good fit since that is too global (I'm running code on apache storm).For my particular use case I only need to set a segment name to use for all KCL calls so it would be ok (in my case) to have a method in
KinesisClientLibConfiguration
to set the tracing name and then the KCL would need to callAWSXRay.beginSegment(tracingName); AWSXRay.endSegment()
in the task submitted to ExecutorServices.