From 8b96f01f3f84782341fe28f29cafc9b9031a8992 Mon Sep 17 00:00:00 2001 From: buildmaster Date: Sun, 22 Oct 2017 17:58:33 +0000 Subject: [PATCH] Sync docs from 1.2.x to gh-pages --- 1.2.x/multi/multi__introduction.html | 16 +--------------- 1.2.x/single/spring-cloud-sleuth.html | 16 +--------------- 1.2.x/spring-cloud-sleuth.xml | 16 +--------------- 3 files changed, 3 insertions(+), 45 deletions(-) diff --git a/1.2.x/multi/multi__introduction.html b/1.2.x/multi/multi__introduction.html index dd9978448..e8f6c295b 100644 --- a/1.2.x/multi/multi__introduction.html +++ b/1.2.x/multi/multi__introduction.html @@ -280,18 +280,4 @@ dependencies { compile "org.springframework.cloud:spring-cloud-stream-binder-rabbit" 4 }

1

In order not to pick versions by yourself it’s much better if you add the dependency management via -the Spring BOM

2

Add the dependency to spring-cloud-sleuth-zipkin-stream

3

Add the dependency to spring-cloud-starter-sleuth - that way all dependant dependencies will be downloaded

4

Add a binder (e.g. Rabbit binder) to tell Spring Cloud Stream what it should bind to

and then just annotate your main class with @EnableZipkinStreamServer annotation:

package example;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.cloud.sleuth.zipkin.stream.EnableZipkinStreamServer;
-
-@SpringBootApplication
-@EnableZipkinStreamServer
-public class ZipkinStreamServerApplication {
-
-	public static void main(String[] args) throws Exception {
-		SpringApplication.run(ZipkinStreamServerApplication.class, args);
-	}
-
-}
\ No newline at end of file +the Spring BOM

2

Add the dependency to spring-cloud-sleuth-zipkin-stream

3

Add the dependency to spring-cloud-starter-sleuth - that way all dependant dependencies will be downloaded

4

Add a binder (e.g. Rabbit binder) to tell Spring Cloud Stream what it should bind to

and then just annotate your main class with @EnableZipkinStreamServer annotation:

Unresolved directive in intro.adoc - include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-sleuth/master/spring-cloud-sleuth-samples/spring-cloud-sleuth-sample-zipkin-stream/src/main/java/example/ZipkinStreamServerApplication.java[]
\ No newline at end of file diff --git a/1.2.x/single/spring-cloud-sleuth.html b/1.2.x/single/spring-cloud-sleuth.html index d6562e838..0d988c56f 100644 --- a/1.2.x/single/spring-cloud-sleuth.html +++ b/1.2.x/single/spring-cloud-sleuth.html @@ -280,21 +280,7 @@ dependencies { compile "org.springframework.cloud:spring-cloud-stream-binder-rabbit" 4 }

1

In order not to pick versions by yourself it’s much better if you add the dependency management via -the Spring BOM

2

Add the dependency to spring-cloud-sleuth-zipkin-stream

3

Add the dependency to spring-cloud-starter-sleuth - that way all dependant dependencies will be downloaded

4

Add a binder (e.g. Rabbit binder) to tell Spring Cloud Stream what it should bind to

and then just annotate your main class with @EnableZipkinStreamServer annotation:

package example;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.cloud.sleuth.zipkin.stream.EnableZipkinStreamServer;
-
-@SpringBootApplication
-@EnableZipkinStreamServer
-public class ZipkinStreamServerApplication {
-
-	public static void main(String[] args) throws Exception {
-		SpringApplication.run(ZipkinStreamServerApplication.class, args);
-	}
-
-}

2. Additional resources

Marcin Grzejszczak talking about Spring Cloud Sleuth and Zipkin

click here to see the video

3. Features

  • Adds trace and span ids to the Slf4J MDC, so you can extract all the logs from a given trace or span in a log aggregator. Example logs:

    2016-02-02 15:30:57.902  INFO [bar,6bfd228dc00d216b,6bfd228dc00d216b,false] 23030 --- [nio-8081-exec-3] ...
    +the Spring BOM

    2

    Add the dependency to spring-cloud-sleuth-zipkin-stream

    3

    Add the dependency to spring-cloud-starter-sleuth - that way all dependant dependencies will be downloaded

    4

    Add a binder (e.g. Rabbit binder) to tell Spring Cloud Stream what it should bind to

and then just annotate your main class with @EnableZipkinStreamServer annotation:

Unresolved directive in intro.adoc - include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-sleuth/master/spring-cloud-sleuth-samples/spring-cloud-sleuth-sample-zipkin-stream/src/main/java/example/ZipkinStreamServerApplication.java[]

2. Additional resources

Marcin Grzejszczak talking about Spring Cloud Sleuth and Zipkin

click here to see the video

3. Features

  • Adds trace and span ids to the Slf4J MDC, so you can extract all the logs from a given trace or span in a log aggregator. Example logs:

    2016-02-02 15:30:57.902  INFO [bar,6bfd228dc00d216b,6bfd228dc00d216b,false] 23030 --- [nio-8081-exec-3] ...
     2016-02-02 15:30:58.372 ERROR [bar,6bfd228dc00d216b,6bfd228dc00d216b,false] 23030 --- [nio-8081-exec-3] ...
     2016-02-02 15:31:01.936  INFO [bar,46ab0d418373cbc9,46ab0d418373cbc9,false] 23030 --- [nio-8081-exec-4] ...

    notice the [appname,traceId,spanId,exportable] entries from the MDC:

    • spanId - the id of a specific operation that took place
    • appname - the name of the application that logged the span
    • traceId - the id of the latency graph that contains the span
    • exportable - whether the log should be exported to Zipkin or not. When would you like the span not to be exportable? In the case in which you want to wrap some operation in a Span and have it written to the logs diff --git a/1.2.x/spring-cloud-sleuth.xml b/1.2.x/spring-cloud-sleuth.xml index c80d74410..b4538c67d 100644 --- a/1.2.x/spring-cloud-sleuth.xml +++ b/1.2.x/spring-cloud-sleuth.xml @@ -648,21 +648,7 @@ the Spring BOM and then just annotate your main class with @EnableZipkinStreamServer annotation: -package example; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cloud.sleuth.zipkin.stream.EnableZipkinStreamServer; - -@SpringBootApplication -@EnableZipkinStreamServer -public class ZipkinStreamServerApplication { - - public static void main(String[] args) throws Exception { - SpringApplication.run(ZipkinStreamServerApplication.class, args); - } - -} +Unresolved directive in intro.adoc - include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-sleuth/master/spring-cloud-sleuth-samples/spring-cloud-sleuth-sample-zipkin-stream/src/main/java/example/ZipkinStreamServerApplication.java[]