From 629fa2511f1f95b60eebcd405a81b637719d033a Mon Sep 17 00:00:00 2001 From: buildmaster Date: Sat, 16 May 2020 07:16:09 +0000 Subject: [PATCH] Sync docs from master to gh-pages --- reference/html/index.html | 20 +++++++++++--------- reference/html/spring-cloud-sleuth.html | 20 +++++++++++--------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/reference/html/index.html b/reference/html/index.html index 6cbbdae93..92043df25 100644 --- a/reference/html/index.html +++ b/reference/html/index.html @@ -1664,23 +1664,24 @@ To achieve that, you can pass the following property to your application to over

11.6. Customization of Reported Spans

Before reporting spans (for example, to Zipkin) you may want to modify that span in some way. -You can do so by using the FinishedSpanHandler interface.

+You can do so by implementing a SpanHandler.

In Sleuth, we generate spans with a fixed name. Some users want to modify the name depending on values of tags. -You can implement the FinishedSpanHandler interface to alter that name.

+You can implement the SpanHandler interface to alter that name.

-

The following example shows how to register two beans that implement FinishedSpanHandler:

+

The following example shows how to register two beans that implement SpanHandler:

@Bean
-FinishedSpanHandler handlerOne() {
-    return new FinishedSpanHandler() {
+SpanHandler handlerOne() {
+    return new SpanHandler() {
         @Override
-        public boolean handle(TraceContext traceContext, MutableSpan span) {
+        public boolean end(TraceContext traceContext, MutableSpan span,
+                Cause cause) {
             span.name("foo");
             return true; // keep this span
         }
@@ -1688,10 +1689,11 @@ FinishedSpanHandler handlerOne() {
 }
 
 @Bean
-FinishedSpanHandler handlerTwo() {
-    return new FinishedSpanHandler() {
+SpanHandler handlerTwo() {
+    return new SpanHandler() {
         @Override
-        public boolean handle(TraceContext traceContext, MutableSpan span) {
+        public boolean end(TraceContext traceContext, MutableSpan span,
+                Cause cause) {
             span.name(span.name() + " bar");
             return true; // keep this span
         }
diff --git a/reference/html/spring-cloud-sleuth.html b/reference/html/spring-cloud-sleuth.html
index 6cbbdae93..92043df25 100644
--- a/reference/html/spring-cloud-sleuth.html
+++ b/reference/html/spring-cloud-sleuth.html
@@ -1664,23 +1664,24 @@ To achieve that, you can pass the following property to your application to over
 

11.6. Customization of Reported Spans

Before reporting spans (for example, to Zipkin) you may want to modify that span in some way. -You can do so by using the FinishedSpanHandler interface.

+You can do so by implementing a SpanHandler.

In Sleuth, we generate spans with a fixed name. Some users want to modify the name depending on values of tags. -You can implement the FinishedSpanHandler interface to alter that name.

+You can implement the SpanHandler interface to alter that name.

-

The following example shows how to register two beans that implement FinishedSpanHandler:

+

The following example shows how to register two beans that implement SpanHandler:

@Bean
-FinishedSpanHandler handlerOne() {
-    return new FinishedSpanHandler() {
+SpanHandler handlerOne() {
+    return new SpanHandler() {
         @Override
-        public boolean handle(TraceContext traceContext, MutableSpan span) {
+        public boolean end(TraceContext traceContext, MutableSpan span,
+                Cause cause) {
             span.name("foo");
             return true; // keep this span
         }
@@ -1688,10 +1689,11 @@ FinishedSpanHandler handlerOne() {
 }
 
 @Bean
-FinishedSpanHandler handlerTwo() {
-    return new FinishedSpanHandler() {
+SpanHandler handlerTwo() {
+    return new SpanHandler() {
         @Override
-        public boolean handle(TraceContext traceContext, MutableSpan span) {
+        public boolean end(TraceContext traceContext, MutableSpan span,
+                Cause cause) {
             span.name(span.name() + " bar");
             return true; // keep this span
         }