aws / aws-xray-sdk-java

The official AWS X-Ray Recorder SDK for Java.
Apache License 2.0
96 stars 99 forks source link

Spring boot 3, apache 5 client, inconsistency with aws-xray-sdk #379

Open oleksandr-skoryi opened 1 year ago

oleksandr-skoryi commented 1 year ago

Hi all, spring boot 3 uses apache 5 client. I want to use com.amazonaws.xray.proxies.apache.http.HttpClientBuilder and inject it in the HttpComponentsClientHttpRequestFactory and then in the rest template. Unfortunately it is not possible, because HttpClientBuilder returns the client for the apache v4. Do you plan to move forward with apache5 or what kind of the workaround do you suggest?

atshaw43 commented 1 year ago

Hello,

Thanks for brining this to our attention!

It looks like apache 4.x and 5.x are incompatible.

And unfortunately there is not an abstract interface we can change to that will work with both. According to the migration guide, we will need a rewrite on some key classes.

I'm afraid I do not see a short term easy fix for you. The solution will require making a parallel set of classe(s) for the new Apache version, specifically around TracedHttpClient. It looks like we just need to swap out the imports, but there may be some functional changes too. More investigation is needed.

I have added a work item in our backlog to look into this.

raftheunis87 commented 1 year ago

Hey @atshaw43, is there any update on this issue?

mxiamxia commented 11 months ago

Hi @raftheunis87 @oleksandr-skoryi , AWS X-Ray is slowing down the new features/changes support on aws-xray-sdk and recommending our customers to use OpenTelemetry SDK for the auto/manual instrumentations in X-Ray. We're providing more richful features and support with OTel solutions. Any obstacle for you to onboard with OTel SDK in X-Ray? Please let us know. Thanks!

LvvvlZ commented 4 months ago

Hey @atshaw43, is there any update on this issue?