We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When upgrading our applications to Spring Boot 3.2.0, we noticed that we stopped getting spans from http client invocations. After some digging, we think the reason is that the http request factory has changed: https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.2-Release-Notes#resttemplate-http-clients
If we opt in to JdkClientHttpRequestFactory, as described, tracing works. However, Apache HttpClient 5 request factory, or the jetty 12 client factory, does not seem to work. For Apache Http Client 5, the problem seem to be that Spring send null as HttpHost here: https://github.com/spring-projects/spring-framework/blob/main/spring-web/src/main/java/org/springframework/http/client/HttpComponentsClientHttpRequest.java#L95
JdkClientHttpRequestFactory
null
HttpHost
which results in a NullPointerException in RequestWithHost:
NullPointerException
RequestWithHost
public RequestWithHost(HttpHost httpHost, ClassicHttpRequest httpRequest) { super(httpRequest); this.scheme = httpHost.getSchemeName(); this.authority = new URIAuthority(httpHost.getHostName(), httpHost.getPort()); }
Intuitive fix is to fetch URIAuthority and scheme from httpRequest:
URIAuthority
scheme
httpRequest
this.scheme = httpRequest.getScheme(); this.authority = httpRequest.getAuthority();
but perhaps there is a reason this is not done in the first place.
For Jetty 12 http client, it seems that support just does not exist.
Span is created for the RestClient call
No span is created
1.32.0
JDK: Azul 17 OS: MacOS
No response
The text was updated successfully, but these errors were encountered:
hi @nilsga! if you'd like to send a PR to fix that would be great
cc @jeanbisutti
Sorry, something went wrong.
Authority from request when HttpHost is null
a1268e7
Fixes open-telemetry#9987
Successfully merging a pull request may close this issue.
Describe the bug
When upgrading our applications to Spring Boot 3.2.0, we noticed that we stopped getting spans from http client invocations. After some digging, we think the reason is that the http request factory has changed: https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.2-Release-Notes#resttemplate-http-clients
If we opt in to
JdkClientHttpRequestFactory
, as described, tracing works. However, Apache HttpClient 5 request factory, or the jetty 12 client factory, does not seem to work. For Apache Http Client 5, the problem seem to be that Spring sendnull
asHttpHost
here: https://github.com/spring-projects/spring-framework/blob/main/spring-web/src/main/java/org/springframework/http/client/HttpComponentsClientHttpRequest.java#L95which results in a
NullPointerException
inRequestWithHost
:Intuitive fix is to fetch
URIAuthority
andscheme
fromhttpRequest
:but perhaps there is a reason this is not done in the first place.
For Jetty 12 http client, it seems that support just does not exist.
Steps to reproduce
Expected behavior
Span is created for the RestClient call
Actual behavior
No span is created
Javaagent or library instrumentation version
1.32.0
Environment
JDK: Azul 17
OS: MacOS
Additional context
No response
The text was updated successfully, but these errors were encountered: