Skip to content

Commit 7b3d023

Browse files
committed
post-review cleanup
1 parent d69e595 commit 7b3d023

File tree

2 files changed

+8
-33
lines changed

2 files changed

+8
-33
lines changed

instrumentation/apache-httpclient/apache-httpclient-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachehttpclient/v5_0/ApacheHttpClientHelper.java

Lines changed: 0 additions & 32 deletions
This file was deleted.

instrumentation/apache-httpclient/apache-httpclient-5.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/apachehttpclient/v5_0/ApacheHttpClientInstrumentation.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import net.bytebuddy.matcher.ElementMatcher;
2929
import org.apache.hc.core5.http.ClassicHttpRequest;
3030
import org.apache.hc.core5.http.HttpHost;
31+
import org.apache.hc.core5.http.HttpResponse;
3132
import org.apache.hc.core5.http.io.HttpClientResponseHandler;
3233

3334
class ApacheHttpClientInstrumentation implements TypeInstrumentation {
@@ -151,7 +152,13 @@ public static AdviceScope start(ClassicHttpRequest request) {
151152

152153
public void end(@Nullable Object result, @Nullable Throwable throwable) {
153154
scope.close();
154-
ApacheHttpClientHelper.doMethodExit(context, request, result, throwable);
155+
if (throwable != null) {
156+
instrumenter().end(context, request, null, throwable);
157+
} else if (result instanceof HttpResponse) {
158+
instrumenter().end(context, request, (HttpResponse) result, null);
159+
} else {
160+
// ended in WrappingStatusSettingResponseHandler
161+
}
155162
}
156163

157164
public WrappingStatusSettingResponseHandler<?> wrapResponseHandler(

0 commit comments

Comments
 (0)