-
Notifications
You must be signed in to change notification settings - Fork 38.4k
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
RestClient observations are stopped before ResponseSpec calls #32575
Comments
Can you share a minimal code snippet showing a case (for example against httpbin.org) of an error not being recorded in the observation? |
Currently on the road, will provide something after some hours, but in general nothing special, just following any of the trivial examples out there The observation monitoring appears to reside within the |
@bclozel here a running scratch:
As mentioned above, Inside |
I think this behavior differs from In general, we try to instrument client and servers as close as possible to the transport level:
I'm declining this issue as a result. |
Thanks for the explanation, I understand, but then do you see any condition, under which any of the catch blocks are ever triggered inside the |
Yes, those are checked exceptions thrown by the code in the
I understand that the behavior is different, but the API is different too. If
It depends on the behavior. As you can see in the code, it can be populated. I think we could extend the error handling to the |
This would solve it, otherwise all the 4xx/5xx are never recorded right. That appears surprising to me |
@hadjiski this is now available in 6.1.7-SNAPSHOT versions, it would be great if you could test it with your application before we cut the release next month. Thanks! |
@bclozel just tried it and unfortunately it did not work, it goes out earlier with an exception and it does not reach the statements. I was using the |
@hadjiski Thanks for testing SNAPSHOTs! I think I got it right this time, the tests setup was initially too invasive and hiding this case. This should be available in SNAPSHOTs shortly. |
yes, I can confirm, this |
@poutsma Since this change I started to get no |
@shakhar have you tried the latest SNAPSHOT version? If so, please create a new issue with a minimal application reproducing the problem. Thanks! |
Yes, tried the latest SNAPSHOT version. I found out that the issue is that I am using |
Let's ask this question differently: what are you expecting from a |
If I need just to send a warmup request without a need to get the actual response data for example |
Debugging a
RestTemplate
shows thatexecute()
bad responses are properly throwing exceptions, which when caught, are setting the error to the observation:Doing the same for the
DefaultRestClient
retrieve
method shows that theclientRequest.execute()
call is not throwing any exception, thus no error is recorded to the observation (later during thetoEntity
call the exception is thrown, but at that time the client observation is already stopped).What is the idea of the new RestClient implementation, how is it supposed to propagate the exception to the observation?
The text was updated successfully, but these errors were encountered: