-
Notifications
You must be signed in to change notification settings - Fork 779
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
Support AsyncRestTemplate #124
Comments
Here you have an example how to set up Ping us back once you confirm that it's working and we'll close this issue. |
Ping? |
Closing due to lack of feedback |
Hi Marcin, first of all I am really sorry for not getting back to you on time. I have tried your changes and it does not fix the issue. The downstream services do not find any X-Trace-Id in the request header. When the downstream service logs their spans, they don't have any parent trace-id hence their trace-id is different to the one originated by the caller service. |
I'll try your example and see what's going on... |
[#124] Added support for async rest template
Thanks for filing this issue - it turned out that actually there is a problem :) In the Brewery it was working because I was using BTW you're using M4 and there is already M5. Some concepts have changed so you'll have to do some minor refactoring:
|
Thanks a lot ! I take that if I migrate to M5, my sample should work. I am working on another account now but as soon as I have a moment I will migrate and back to you if I have any issues. |
I'm new in Spring, and it's support tools (like dependency version handling). How can I get this working? |
@tg44 can you post your sample app so that we can check it out? |
Declarations. |
Hi! Can you check if the issue is there with current version in master? |
Ok I'm looking at your code and I think that I found the issue. You register your own Can you check how we're registering the async rest template and do it accordingly? I guess it would look sth like this:
Just ensure with a debugger that |
Everything works fine, there was a missuse on my side. (just use @Autowired and don't use new :) ) |
Thanks a lot and sorry for not getting back to you earlier. I am involved in a critical issue very recently and I have not had time to look at this.
|
It appears there is no support for
AsyncRestTemplate
. Sleuth has no way of intercepting the client's async requests to inject the corresponding headers. Therefore, it sends the requests without them. And of course, the responses do not carry them either and as a consequence Sleuth cannot propagate those headers into the thread running the ListenableFuture's callback.I am using a sample project to demonstrate it : https://github.com/pivotalcsoemea/distributed-tracing-demo/blob/master/gateway/src/main/java/io/pivotal/demo/gateway/AsyncController.java#L51
I have noticed that when the inner Restful request (https://github.com/pivotalcsoemea/distributed-tracing-demo/blob/master/gateway/src/main/java/io/pivotal/demo/gateway/AsyncController.java#L72) is invoked, Sleuth logs the following statement (I have included the two previous statements for reference):
The text was updated successfully, but these errors were encountered: