-
Notifications
You must be signed in to change notification settings - Fork 647
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
Tracing Context not logged when replacing ReactorNettyHttpTracing with standard HttpClient/HttpServer integration #2850
Comments
@grassehh Please provide reproducible example. |
Hello, I updated the whole description and provided a sample. Thanks. |
@grassehh Can you try this?
This is described in the reference documentation in the section for custom |
Thanks for the answer. I confirm the solution works. I have updated the branch consequently. I have slightly simplified the client customizer by naming the method However I have few more questions/remarks about it:
The server customizer looks like this :
and when calling the app, the request/response logs have empty MDC. Example of request log:
Again, the sample has been updated you can check it out. |
The
Decorating Netty events with
Context Propagation library is generic one, it does not depend on any specific project so it is up to Logbook project whether they want to use it.
As you can see for the client we don't need anything specific from Reactor Netty, just a custom Netty ChannelHandler. request -> Reactor Netty -> Spring framework creates Observation response -> Spring framework closes Observation -> Reactor Netty As you can see everything that is NOT in the scope of the framework cannot see the Observation. This is the case with Logbook. In this case you will need Reactor Netty <-> Micrometer integration. I need to check for a fix in Spring and I'll try to come up with a customiser for the server. |
So if I understand correctly and sum up, this means that it requires Logbook to implement Reactor Netty <-> Micrometer integration in order to:
|
mmm not exactly ... |
@grassehh This should be working for the server:
For the
The idea is to provide a templating if possible e.g. if the uri is
|
I updated the branch with your suggested server implementation. |
|
@grassehh can you please change the project to Java? Let's try fixing one problem at a time and adding Kotlin makes things more complicated. Thank you |
@grassehh Closing this issue. If you can provide the requested example in Java, showing the issue, we can reopen it. |
Hello @violetagg @marcingrzejszczak As you can see, the custom baggages are still not logged in the server request/response logs:
|
@marcingrzejszczak PTAL |
@grassehh I would suggest to open an issue either in Spring or Micrometer. I don't know how Reactor Netty can help with custom baggages. However if the issue appears to be in Reactor Netty, we can always reopen the issue. |
Hey, I've updated Tracing version 1.1.x and 1.2.x with fixes related to baggage recently. Since this week is my Spring Cloud week I can look into checking this next week |
Thanks. Should I still open an issue on Spring or somewhere else ? Or can I wait for your feedback next week here ? |
I mean you can bump tracing to the latest 1.1.x snapshot and check it for yourself or wait for a week for me to check it |
Hello, I have upgraded the dependencies on the Baggage still are not logged in the Server request/response logs (only traceId and spanId) |
Have you used the baggage API properly? Here you can find an example https://github.com/micrometer-metrics/tracing/blob/main/micrometer-tracing-bridges/micrometer-tracing-bridge-brave/src/test/java/io/micrometer/tracing/brave/bridge/BaggageTests.java#L180-L210 |
The way I do it (you can check in the
So far like I said, the issue is that the custom bagage (created through This used to work well with Spring Sleuth, and it no longer works in Spring Boot 3 w/ Micrometer Tracing, since I replaced the deprecated |
Hi, @marcingrzejszczak @violetagg. The call stack is as follow:
|
the solution with TracingChannelDuplexHandler worked fine in spring boot 3.1* but upgrading it to 3.2.0 broke the solution, now the traceid in webclient is different from others any solution ? |
@Ricard-Kollcaku Please provide reproducible example. |
@violetagg I've updated my issue with the same regression observed (reproducer here on branch issues/micrometer-tracing) |
@grassehh @Ricard-Kollcaku Can you please test with Spring Framework |
Confirm this works for me with 6.1.2-SNAPSHOT ! Thanks you ! |
@Ricard-Kollcaku I'm closing this one. Reactor Netty version for Spring Boot 3.x versions is one and the same - 1.1.x. |
Describe the Bug
Spring Boot 2 with Spring Sleuth -> Spring Boot 3 with Micrometer migration
Hello, I'm aware that as explained in the Javadoc,
ReactorNettyHttpTracing
will be deprecated in next major version.As a consequence, I am trying to find an alternative.
As explained here and on the official documentation, it is said that one need to use the built-in metrics of Netty Reactor.
However in a Spring Boot 3 environment with Micrometer, I am not sure of how to do this, but it seems that it is not working correctly.
Steps to Reproduce
issues/reactor-netty
branchYou will see that in the webClient log, there is no baggage logged in the MDC:
However if you edit
ClientConfiguration.httpClientCustomizer
method by replacing this code:with this code:
and do the same test, you will see that all the baggages are now correctly logged (traceId, spanId, myBaggageFitler, myBaggageController):
Expected result
The baggages in tracing context (traceId, spanId and baggages in scope) should be logged in both Server/Client request/responses when using the built-in
HttpClient.metrics
andHttpService.metrics
methods instead of the deprecatedReactorNettyHttpTracing
class.Thanks for the help !
The text was updated successfully, but these errors were encountered: