3

I should say I'm really impressed with the simplicity and usefulness of spring-cloud-sleuth and zipkin.

However, I'm working on a POC for which I'm considering reactive toolkits. Vertx 3 is the first item in my list to try (with spring cloud ecosystem). I'm wondering if Sleuth log tracing would work in a reactive context as I guess it relies on ThreadLocals to pass around the context? Keen to understand where Sleuth would stand in a reactive environment.

user1189332
  • 1,773
  • 4
  • 26
  • 46

1 Answers1

3

Thanks for the kind words! In Sleuth Edgware we will support Reactor - https://github.com/spring-cloud/spring-cloud-sleuth/tree/master/spring-cloud-sleuth-reactor and in Sleuth Finchley we will support reactor and webflux https://github.com/spring-cloud/spring-cloud-sleuth/blob/2.0.x/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/web/TraceWebFluxAutoConfiguration.java. In other words it's already possible to use Sleuth in the reactive context.

Marcin Grzejszczak
  • 10,624
  • 1
  • 16
  • 32
  • Is it already in Finchley M1? Is it safe to remove dependency spring-web, use spring-webflux instead? – Kane Aug 08 '17 at 15:34
  • https://github.com/spring-cloud/spring-cloud-release/milestones?direction=asc&sort=due_date&state=open - you can check out the release calendar over here. Safe is a strong word ;) – Marcin Grzejszczak Aug 08 '17 at 15:37
  • @Marcin Grzejszczak, how is the tracing information passed around without ThreadLocal mechanism? I'm just curious how it's implemented under the hood. – k13i Jul 25 '19 at 13:18
  • The answer is here https://github.com/spring-cloud/spring-cloud-sleuth/blob/master/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/reactor/TraceReactorAutoConfiguration.java , what we're doing is that we're wrapping reactor's schedulers and we're wrapping the oneach operator mechanism where we instrument every single operator. We're working on changing reactor to make that more performant – Marcin Grzejszczak Jul 26 '19 at 08:37