Aws Xray support for apache HttpAsyncClientBuilder

0

We recently upgraded our service backend from Elasticsearch to Opensearch. The elasticsearch client used the apache HttpClient and HttpClientBuilder to make http calls. I was able to use the aws xray TracedHttpClient in the client chain in order to trace all http requests made to Elasticsearch, as shown below

  @Override
  protected HttpClientBuilder configureHttpClient(HttpClientBuilder builder) {
    return new HttpClientBuilder() {
      @Override
      public CloseableHttpClient build() {
        return new TracedHttpClient(builder.build());
      }
    };
  }

However, the Opensearch java clients use the apache HttpAsyncClient and HttpAsyncClientBuilder, which is incompatible with the TracedHttpClient.

Other than making my own implementation of a TracedHttpAsyncClient, is there any other way to add xray tracing through an HttpAsyncClient for every request?

질문됨 일 년 전268회 조회
1개 답변
0
수락된 답변

The library instrumentations (such as HttpAsyncClient) are wrapping the target with tracing APIs. If XRay SDK does not provide the library support, user can manage that by himself. It is inconvenient for user, so, please try to onboard ADOT, there are more powerful contributors provide new libraries support.

답변함 10달 전
  • Thanks for the suggestions! I'll look into using ADOT and see if that can solve our problems

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인