-
Notifications
You must be signed in to change notification settings - Fork 867
New issue
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
jetty-httpclient erroneously returns an empty response when instrumented #3826
Comments
cc: @robododge |
Hi @seshness, thanks for pointing this out. I replicated this situation. There is definitely an issue with Jetty httpclient and redirects. A couple of things:
So, yes, it appears to be an issue during an attempt to follow redirects when instrumentation is active. |
@trask please assign |
My understanding is that the problem is with |
Thanks for the quick fix @laurit & @robododge! ⚡ |
Thanks @laurit, I pulled down your PR and tested as well. It seems this problem occurs regardless of redirect handling when getContentAsString() is called because the onContent() callback was not getting invoked. You covered the ResponseCallbacks, but I found another place where wrapping of the callbacks is not complete, the RequestListeners callback wrapping is missing some callback interfaces, should we add that fix to this PR? Edit: new PR created |
Describe the bug
When I make a request with
jetty-httpclient
, with instrumentation applied, the response is empty.When I make the same request without instrumentation, the response is non-empty as expected.
Steps to reproduce
jetty-httpclient
-javaagent:<path to opentelemetry-javaagent-all.jar>
What did you expect to see?
When I make this request with
curl
or without instrumentation I see a non-empty response:What did you see instead?
With instrumentation enabled the response is empty.
response.getContentAsString()
produces an empty string.What version are you using?
org.eclipse.jetty:jetty-client:9.4.40.v20210413
opentelemetry-javaagent-all.jar
at v1.4.1Environment
Compiler: AdoptOpenJDK-11.0.11+9 (build 11.0.11+9)
OS: macOS 10.15.7
Runtime (if different from JDK above): AdoptOpenJDK-11.0.11+9 (build 11.0.11+9)
OS (if different from OS compiled on): macOS 10.15.7
Additional context
I tried reproducing with a few other
jetty-httpclient
versions too:The text was updated successfully, but these errors were encountered: