diff --git a/spring-cloud-sleuth.html b/spring-cloud-sleuth.html index 5641601c3..a0ba665cb 100644 --- a/spring-cloud-sleuth.html +++ b/spring-cloud-sleuth.html @@ -1617,8 +1617,14 @@ just set spring.sleuth.web.client.enabled to false.

Asynchronous Rest Template

-

Custom instrumentation is set to create and close Spans upon sending and receiving requests. To block the AsyncRestTemplate -features set spring.sleuth.web.async.client.enabled to false.

+

Custom instrumentation is set to create and close Spans upon sending and receiving requests. You can customize the ClientHttpRequestFactory +and the AsyncClientHttpRequestFactory by registering your beans. Remember to use tracing compatible implementations (e.g. don’t forget to +wrap ThreadPoolTaskScheduler in a TraceAsyncListenableTaskExecutor).

+
+
+

To block the AsyncRestTemplate features set spring.sleuth.web.async.client.enabled to false. +To disable creation of the default TraceAsyncClientHttpRequestFactoryWrapper set spring.sleuth.web.async.client.factory.enabled +to false. If you don’t want to create AsyncRestClient at all set spring.sleuth.web.async.client.template.enabled to false.

@@ -1687,6 +1693,19 @@ by setting the value of spring.sleuth.scheduled.enabled to fa

We’re providing LazyTraceExecutor, TraceableExecutorService and TraceableScheduledExecutorService. Those implementations are creating Spans each time a new task is submitted, invoked or scheduled.

+
+

Here you can see an example of how to pass tracing information with TraceableExecutorService when working with CompletableFuture:

+
+
+
+
CompletableFuture<Long> completableFuture = CompletableFuture.supplyAsync(() -> {
+	// perform some logic
+	return 1_000_000L;
+}, new TraceableExecutorService(Executors.newCachedThreadPool(),
+		// 'calculateTax' explicitly names the span - this param is optional
+		tracer, traceKeys, spanNamer, "calculateTax"));
+
+
@@ -1708,7 +1727,7 @@ To disable Zuul support set the spring.sleuth.zuul.enabled property