Skip to content
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

trace id is not propagated to access logs properly using reactor #2132

Closed
PH1P5 opened this issue Mar 23, 2022 · 2 comments
Closed

trace id is not propagated to access logs properly using reactor #2132

PH1P5 opened this issue Mar 23, 2022 · 2 comments
Projects
Milestone

Comments

@PH1P5
Copy link

PH1P5 commented Mar 23, 2022

Describe the bug
Creating a Spring WebFlux app with project reactor we recognized, that using Flux publisher the trace id is not logged in the access logs (via mdc).

Sample

https://github.com/PH1P5/reactor-sleuth-sample

We provided this sample repository to reproduce the issue. Please see all the necessary information in the README and also, logback-spring.xml and SampleController for further details.

@marcingrzejszczak investigating this bug we saw that you often were involved in similar discussions like:
#1748

We would really appreciate your help, thanks in advance

@PH1P5
Copy link
Author

PH1P5 commented Apr 7, 2022

Could anyone please respond, we are currently working with a workaround which not fits our needs.

@marcingrzejszczak
Copy link
Contributor

Let's start with the workaround. Please add the io.projectreactor.netty:reactor-netty-http-brave dependency and then set up the following configuration

@Configuration(proxyBeanMethods = false)
class Config {

	@Bean
	NettyServerCustomizer traceNettyServerCustomizer(ObjectProvider<HttpTracing> tracing) {
		return server -> ReactorNettyHttpTracing.create(tracing.getObject()).decorateHttpServer(server);
	}
}

that should work. Since this is actually a new feature and we're not planning to add any new features to Sleuth most likely we'll just document this.

@marcingrzejszczak marcingrzejszczak added this to To do in 2021.0.2 via automation Apr 14, 2022
@marcingrzejszczak marcingrzejszczak added this to the 3.1.2 milestone Apr 14, 2022
2021.0.2 automation moved this from To do to Done Apr 14, 2022
PH1P5 added a commit to PH1P5/reactor-sleuth-sample that referenced this issue Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
2021.0.2
  
Done
Development

No branches or pull requests

3 participants