-
Notifications
You must be signed in to change notification settings - Fork 40.2k
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
TraceId is not propagating in microservices using micrometer and zipkin #40704
Comments
Thanks for the report. Unfortunately, it doesn't include enough information for us to be able to diagnose the problem. For example, you haven't shown how the requests are being made (all we know is that you're using If you would like us to spend some more time investigating, please spend some time providing a complete yet minimal sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue. |
Hi @wilkinsona I've created a own myWebClient class to define the WebClient . Calling this get method to calling the service 2 api's. I don't have issues with inter service call request and response. Only having issue with the same traceId is not propagating from service 1 to service2. Let me know if there is any missing dependencies or yml properties or any other related configurations is there.
|
There's still a lot that's missing, I'm afraid. For example, I can't easily tell what propagation format service 1 is producing and what propagation format(s) service 2 is consuming. I can also see that you're creating some components yourself which means that you'll lose Spring Boot's corresponding auto-configuration. As I said above, if you would like us to spend some more time investigating, please spend some time providing a complete yet minimal sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue. If you can't provide us with such a sample then I'm afraid that we'll probably have to close this issue as it is not actionable in its current form. |
@pSinghDelaplex You have to use WebClient.builder as autowired bean otherwise observability won't work. so your method should be like following: |
Hi @himanshunp It helped me out. Thankful for your suggestion |
I'm generating request from service 1 to service 2 , traceId and spanId are getting generated in the logs for service 1 but when calls service 2 REST API, traceId and spanId get changed. TraceId should be constant for the complete request and response call but it is not happening it also getting changed. I'm running my zipkin server locally and using WebClient for sending request for service calls.
Microservice 1
build.gradle
application.yml
SpringBootApplication.java
log4j2-spring.yml
Microservice 2
build.gradle
application.yml
SpringBootApplication.java
log4j2-spring.yml
The text was updated successfully, but these errors were encountered: