From 7787f53f69f5de2615c0c7aba5c21b3da39f2c79 Mon Sep 17 00:00:00 2001 From: buildmaster Date: Fri, 14 Dec 2018 08:43:01 +0000 Subject: [PATCH] Sync docs from master to gh-pages --- multi/multi__integrations.html | 11 ++++++----- multi/multi__naming_spans.html | 4 ++-- single/spring-cloud-sleuth.html | 15 ++++++++------- spring-cloud-sleuth.xml | 17 +++++++++-------- 4 files changed, 25 insertions(+), 22 deletions(-) diff --git a/multi/multi__integrations.html b/multi/multi__integrations.html index 03eeb3bec..be138627e 100644 --- a/multi/multi__integrations.html +++ b/multi/multi__integrations.html @@ -14,11 +14,12 @@ If you wish to disable this, set spring.sleuth.opentracing } }; // Manual `TraceRunnable` creation with explicit "calculateTax" Span name -Runnable traceRunnable = new TraceRunnable(tracing, spanNamer, runnable, +Runnable traceRunnable = new TraceRunnable(this.tracing, spanNamer, runnable, "calculateTax"); // Wrapping `Runnable` with `Tracing`. That way the current span will be available // in the thread of `Runnable` -Runnable traceRunnableFromTracer = tracing.currentTraceContext().wrap(runnable);

The following example shows how to do so for Callable:

Callable<String> callable = new Callable<String>() {
+Runnable traceRunnableFromTracer = this.tracing.currentTraceContext()
+		.wrap(runnable);

The following example shows how to do so for Callable:

Callable<String> callable = new Callable<String>() {
 	@Override
 	public String call() throws Exception {
 		return someLogic();
@@ -30,11 +31,11 @@ Runnable traceRunnableFromTracer = tracing.currentTraceContext().wrap(runnable);
 	}
 };
 // Manual `TraceCallable` creation with explicit "calculateTax" Span name
-Callable<String> traceCallable = new TraceCallable<>(tracing, spanNamer, callable,
-		"calculateTax");
+Callable<String> traceCallable = new TraceCallable<>(this.tracing, spanNamer,
+		callable, "calculateTax");
 // Wrapping `Callable` with `Tracing`. That way the current span will be available
 // in the thread of `Callable`
-Callable<String> traceCallableFromTracer = tracing.currentTraceContext()
+Callable<String> traceCallableFromTracer = this.tracing.currentTraceContext()
 		.wrap(callable);

That way, you ensure that a new span is created and closed for each execution.

15.3 Hystrix

15.3.1 Custom Concurrency Strategy

We register a custom HystrixConcurrencyStrategy called TraceCallable that wraps all Callable instances in their Sleuth representative. The strategy either starts or continues a span, depending on whether tracing was already going on before the Hystrix command was called. To disable the custom Hystrix Concurrency Strategy, set the spring.sleuth.hystrix.strategy.enabled to false.

15.3.2 Manual Command setting

Assume that you have the following HystrixCommand:

HystrixCommand<String> hystrixCommand = new HystrixCommand<String>(setter) {
diff --git a/multi/multi__naming_spans.html b/multi/multi__naming_spans.html
index de3accbe9..ff677745d 100644
--- a/multi/multi__naming_spans.html
+++ b/multi/multi__naming_spans.html
@@ -9,14 +9,14 @@ The name should be low cardinality, so it should not include identifiers.

// perform logic } -}

In this case, when processed in the following manner, the span is named calculateTax:

Runnable runnable = new TraceRunnable(tracing, spanNamer,
+}

In this case, when processed in the following manner, the span is named calculateTax:

Runnable runnable = new TraceRunnable(this.tracing, spanNamer,
 		new TaxCountingRunnable());
 Future<?> future = executorService.submit(runnable);
 // ... some additional logic ...
 future.get();

10.2 toString() method

It is pretty rare to create separate classes for Runnable or Callable. Typically, one creates an anonymous instance of those classes. You cannot annotate such classes. -To overcome that limitation, if there is no @SpanName annotation present, we check whether the class has a custom implementation of the toString() method.

Running such code leads to creating a span named calculateTax, as shown in the following example:

Runnable runnable = new TraceRunnable(tracing, spanNamer, new Runnable() {
+To overcome that limitation, if there is no @SpanName annotation present, we check whether the class has a custom implementation of the toString() method.

Running such code leads to creating a span named calculateTax, as shown in the following example:

Runnable runnable = new TraceRunnable(this.tracing, spanNamer, new Runnable() {
 	@Override
 	public void run() {
 		// perform logic
diff --git a/single/spring-cloud-sleuth.html b/single/spring-cloud-sleuth.html
index 46565c481..b79549ec3 100644
--- a/single/spring-cloud-sleuth.html
+++ b/single/spring-cloud-sleuth.html
@@ -612,14 +612,14 @@ The name should be low cardinality, so it should not include identifiers.

// perform logic } -}

In this case, when processed in the following manner, the span is named calculateTax:

Runnable runnable = new TraceRunnable(tracing, spanNamer,
+}

In this case, when processed in the following manner, the span is named calculateTax:

Runnable runnable = new TraceRunnable(this.tracing, spanNamer,
 		new TaxCountingRunnable());
 Future<?> future = executorService.submit(runnable);
 // ... some additional logic ...
 future.get();

10.2 toString() method

It is pretty rare to create separate classes for Runnable or Callable. Typically, one creates an anonymous instance of those classes. You cannot annotate such classes. -To overcome that limitation, if there is no @SpanName annotation present, we check whether the class has a custom implementation of the toString() method.

Running such code leads to creating a span named calculateTax, as shown in the following example:

Runnable runnable = new TraceRunnable(tracing, spanNamer, new Runnable() {
+To overcome that limitation, if there is no @SpanName annotation present, we check whether the class has a custom implementation of the toString() method.

Running such code leads to creating a span named calculateTax, as shown in the following example:

Runnable runnable = new TraceRunnable(this.tracing, spanNamer, new Runnable() {
 	@Override
 	public void run() {
 		// perform logic
@@ -800,11 +800,12 @@ If you wish to disable this, set spring.sleuth.opentracing
 	}
 };
 // Manual `TraceRunnable` creation with explicit "calculateTax" Span name
-Runnable traceRunnable = new TraceRunnable(tracing, spanNamer, runnable,
+Runnable traceRunnable = new TraceRunnable(this.tracing, spanNamer, runnable,
 		"calculateTax");
 // Wrapping `Runnable` with `Tracing`. That way the current span will be available
 // in the thread of `Runnable`
-Runnable traceRunnableFromTracer = tracing.currentTraceContext().wrap(runnable);

The following example shows how to do so for Callable:

Callable<String> callable = new Callable<String>() {
+Runnable traceRunnableFromTracer = this.tracing.currentTraceContext()
+		.wrap(runnable);

The following example shows how to do so for Callable:

Callable<String> callable = new Callable<String>() {
 	@Override
 	public String call() throws Exception {
 		return someLogic();
@@ -816,11 +817,11 @@ Runnable traceRunnableFromTracer = tracing.currentTraceContext().wrap(runnable);
 	}
 };
 // Manual `TraceCallable` creation with explicit "calculateTax" Span name
-Callable<String> traceCallable = new TraceCallable<>(tracing, spanNamer, callable,
-		"calculateTax");
+Callable<String> traceCallable = new TraceCallable<>(this.tracing, spanNamer,
+		callable, "calculateTax");
 // Wrapping `Callable` with `Tracing`. That way the current span will be available
 // in the thread of `Callable`
-Callable<String> traceCallableFromTracer = tracing.currentTraceContext()
+Callable<String> traceCallableFromTracer = this.tracing.currentTraceContext()
 		.wrap(callable);

That way, you ensure that a new span is created and closed for each execution.

15.3 Hystrix

15.3.1 Custom Concurrency Strategy

We register a custom HystrixConcurrencyStrategy called TraceCallable that wraps all Callable instances in their Sleuth representative. The strategy either starts or continues a span, depending on whether tracing was already going on before the Hystrix command was called. To disable the custom Hystrix Concurrency Strategy, set the spring.sleuth.hystrix.strategy.enabled to false.

15.3.2 Manual Command setting

Assume that you have the following HystrixCommand:

HystrixCommand<String> hystrixCommand = new HystrixCommand<String>(setter) {
diff --git a/spring-cloud-sleuth.xml b/spring-cloud-sleuth.xml
index 17c43a9b1..2c1dc5754 100644
--- a/spring-cloud-sleuth.xml
+++ b/spring-cloud-sleuth.xml
@@ -4,7 +4,7 @@
 
 
 Spring Cloud Sleuth
-2018-12-13
+2018-12-14
 
 
 Adrian Cole, Spencer Gibb, Marcin Grzejszczak, Dave Syer, Jay Bryant
@@ -1322,7 +1322,7 @@ class TaxCountingRunnable implements Runnable {
 
 }
 In this case, when processed in the following manner, the span is named calculateTax:
-Runnable runnable = new TraceRunnable(tracing, spanNamer,
+Runnable runnable = new TraceRunnable(this.tracing, spanNamer,
 		new TaxCountingRunnable());
 Future<?> future = executorService.submit(runnable);
 // ... some additional logic ...
@@ -1335,7 +1335,7 @@ Typically, one creates an anonymous instance of those classes.
 You cannot annotate such classes.
 To overcome that limitation, if there is no @SpanName annotation present, we check whether the class has a custom implementation of the toString() method.
 Running such code leads to creating a span named calculateTax, as shown in the following example:
-Runnable runnable = new TraceRunnable(tracing, spanNamer, new Runnable() {
+Runnable runnable = new TraceRunnable(this.tracing, spanNamer, new Runnable() {
 	@Override
 	public void run() {
 		// perform logic
@@ -1675,11 +1675,12 @@ If you wish to disable this, set spring.sleuth.opentracing.enabled
+Runnable traceRunnableFromTracer = this.tracing.currentTraceContext()
+		.wrap(runnable);
 The following example shows how to do so for Callable:
 Callable<String> callable = new Callable<String>() {
 	@Override
@@ -1693,11 +1694,11 @@ Runnable traceRunnableFromTracer = tracing.currentTraceContext().wrap(runnable);
 	}
 };
 // Manual `TraceCallable` creation with explicit "calculateTax" Span name
-Callable<String> traceCallable = new TraceCallable<>(tracing, spanNamer, callable,
-		"calculateTax");
+Callable<String> traceCallable = new TraceCallable<>(this.tracing, spanNamer,
+		callable, "calculateTax");
 // Wrapping `Callable` with `Tracing`. That way the current span will be available
 // in the thread of `Callable`
-Callable<String> traceCallableFromTracer = tracing.currentTraceContext()
+Callable<String> traceCallableFromTracer = this.tracing.currentTraceContext()
 		.wrap(callable);
 That way, you ensure that a new span is created and closed for each execution.