hypertrace / javaagent

Hypertrace OpenTelemetry Java agent with payload/body and headers data capture.
Apache License 2.0
34 stars 15 forks source link

Response body is not captured in apache async client if the body is not read in callback #248

Open pavolloffay opened 3 years ago

pavolloffay commented 3 years ago
    Future<HttpResponse> responseFuture = client.execute(request, null);
    HttpResponse response = responseFuture.get();
    if (response.getEntity() == null || response.getEntity().getContentLength() <= 0) {
      return Pair.of(response.getStatusLine().getStatusCode(), null);
    }
    String responseBody = readInputStream(response.getEntity().getContent());