From 135b29e475d92adb794ca46f4682009ff877a92b Mon Sep 17 00:00:00 2001 From: buildmaster Date: Mon, 18 Dec 2017 16:05:34 +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, 45 insertions(+), 3 deletions(-) diff --git a/1.2.x/multi/multi__introduction.html b/1.2.x/multi/multi__introduction.html index e8f6c295b..dd9978448 100644 --- a/1.2.x/multi/multi__introduction.html +++ b/1.2.x/multi/multi__introduction.html @@ -280,4 +280,18 @@ 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:

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 +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 diff --git a/1.2.x/single/spring-cloud-sleuth.html b/1.2.x/single/spring-cloud-sleuth.html index 62f7689aa..98807e6cd 100644 --- a/1.2.x/single/spring-cloud-sleuth.html +++ b/1.2.x/single/spring-cloud-sleuth.html @@ -280,7 +280,21 @@ 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:

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] ...
    +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] ...
     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 7104162cb..152d0d0c5 100644 --- a/1.2.x/spring-cloud-sleuth.xml +++ b/1.2.x/spring-cloud-sleuth.xml @@ -648,7 +648,21 @@ the Spring BOM 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[] +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); + } + +}