-
Notifications
You must be signed in to change notification settings - Fork 324
Open
Labels
type: bugBug report and fixBug report and fix
Description
Tracer Version(s)
1.57.0
Java Version(s)
25
JVM Vendor
Eclipse Adoptium / Temurin
Bug Report
When using apache httpclient v5, it is possible to do http requests from with exec interceptors (type org.apache.hc.client5.http.classic.ExecChainHandler) added on a http client. This is e.g. useful for fetching a token to add it as a header on a requests. The requests done in such an interceptor are not instrumented because of this if. Would it be possible to fix this, so that traces do not miss http calls?
Expected Behavior
All http calls are recorded in the trace, even when they are executed from within an interceptor.
Reproduction Code
try(CloseableHttpClient httpClient = HttpClientBuilder.create()
.addExecInterceptorLast("interceptor", (request, scope, chain) -> {
CloseableHttpClient tokenHttpClient = HttpClientBuilder.create().build();
String token = tokenHttpClient.execute(new HttpGet("..."), resp -> {
// ...
return fetchedToken;
});
request.addHeader("x-token", token);
return chain.proceed(request, scope);
})
.build()) {
httpClient.execute(new HttpGet("..."), response -> {
// ...
return null;
});
}Metadata
Metadata
Assignees
Labels
type: bugBug report and fixBug report and fix