From aabae5668512a6b3951cf3d26ffa8609e6a5cb14 Mon Sep 17 00:00:00 2001
From: buildmaster If If using Zipkin or Stream, configure the percentage of spans exported using If using Zipkin, configure the percentage of spans exported using <dependency>
In order not to pick versions by yourself it’s much better if you add the dependency management via
-the Spring BOM Add the dependency to Gradle.
+the Spring BOM Add the dependency to Gradle.
SpanInjector and SpanExtractor implementations.spring-cloud-sleuth-zipkin then the app will generate and collect Zipkin-compatible traces.
+a baggage element then it will be sent downstream either via HTTP or messaging to other processes.spring-cloud-sleuth-zipkin2 then the app will generate and collect Zipkin-compatible traces.
By default it sends them via HTTP to a Zipkin server on localhost (port 9411).
-Configure the location of the service using spring.zipkin.baseUrl.spring-cloud-sleuth-stream then the app will generate and collect traces via Spring Cloud Stream.
-Your app automatically becomes a producer of tracer messages that are sent over your broker of choice
-(e.g. RabbitMQ, Apache Kafka, Redis).![[Important]](images/important.png)
Important spring.sleuth.sampler.percentage
+Configure the location of the service using spring.zipkin.baseUrl.spring-rabbit or spring-kafka your app will send traces to a broker instead of http.spring-cloud-sleuth-stream is deprecated and should no longer be used.![[Important]](images/important.png)
Important spring.sleuth.sampler.percentage
(default 0.1, i.e. 10%). Otherwise you might think that Sleuth is not working cause it’s omitting some spans.
<groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-starter-zipkin</artifactId>
+ <artifactId>spring-cloud-starter-zipkin2</artifactId>
</dependency>spring-cloud-starter-zipkinspring-cloud-starter-zipkin2dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${releaseTrainVersion}"
@@ -195,10 +195,12 @@ the Spring BOM
- compile "org.springframework.cloud:spring-cloud-starter-zipkin"
+ compile "org.springframework.cloud:spring-cloud-starter-zipkin2"
}
In order not to pick versions by yourself it’s much better if you add the dependency management via -the Spring BOM | |
Add the dependency to |
Add the dependency to spring-cloud-starter-zipkin2
If you want to use RabbitMQ or Kafka instead of http, add the spring-rabbit or spring-kafka
+dependencies. The default destination name is zipkin.
Note: spring-cloud-sleuth-stream is deprecated and incompatible with these destinations
If you want Sleuth over RabbitMQ add the spring-cloud-sleuth-starter-zipkin2 and spring-rabbit
+dependencies.
Maven.
<dependencyManagement><dependencies> <dependency> @@ -213,19 +215,14 @@ the Spring BOM
<dependency>
<groupId>org.springframework.cloud</groupId> - <artifactId>spring-cloud-sleuth-stream</artifactId> + <artifactId>spring-cloud-sleuth-starter-zipkin2</artifactId> </dependency> <dependency>
- <groupId>org.springframework.cloud</groupId> - <artifactId>spring-cloud-starter-sleuth</artifactId> - </dependency> - <!-- EXAMPLE FOR RABBIT BINDING --> - <dependency>
- <groupId>org.springframework.cloud</groupId> - <artifactId>spring-cloud-stream-binder-rabbit</artifactId> + <groupId>org.springframework.amqp</groupId> + <artifactId>spring-rabbit</artifactId> </dependency>
In order not to pick versions by yourself it’s much better if you add the dependency management via -the Spring BOM
Add the dependency to
spring-cloud-sleuth-streamAdd the dependency to
spring-cloud-starter-sleuth- that way all dependant dependencies will be downloadedAdd a binder (e.g. Rabbit binder) to tell Spring Cloud Stream what it should bind to
Gradle. +the Spring BOM
Add the dependency to
spring-cloud-starter-sleuth-zipkin2- that way all dependent dependencies will be downloadedTo automatically configure rabbit, simply add the spring-rabbit dependency
Gradle.
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${releaseTrainVersion}"
@@ -233,66 +230,8 @@ the Spring BOM"org.springframework.cloud:spring-cloud-sleuth-stream"
- compile "org.springframework.cloud:spring-cloud-starter-sleuth"
- // Example for Rabbit binding
- compile "org.springframework.cloud:spring-cloud-stream-binder-rabbit"
+ compile "org.springframework.cloud:spring-cloud-starter-sleuth-zipkin2"
+ compile "org.springframework.amqp:spring-rabbit"
}
In order not to pick versions by yourself it’s much better if you add the dependency management via
-the Spring BOM
Add the dependency to spring-cloud-sleuth-stream
Add the dependency to spring-cloud-starter-sleuth - that way all dependant dependencies will be downloaded
Add a binder (e.g. Rabbit binder) to tell Spring Cloud Stream what it should bind to
If you want to start a Spring Cloud Sleuth Stream Zipkin collector just add the spring-cloud-sleuth-zipkin-stream
-dependency
Maven.
-
<dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-dependencies</artifactId>
- <version>${release.train.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-sleuth-zipkin-stream</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-starter-sleuth</artifactId>
- </dependency>
- <!-- EXAMPLE FOR RABBIT BINDING -->
- <dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-stream-binder-rabbit</artifactId>
- </dependency>
-
In order not to pick versions by yourself it’s much better if you add the dependency management via
-the Spring BOM
Add the dependency to spring-cloud-sleuth-zipkin-stream
Add the dependency to spring-cloud-starter-sleuth - that way all dependant dependencies will be downloaded
Add a binder (e.g. Rabbit binder) to tell Spring Cloud Stream what it should bind to
Gradle.
-
dependencyManagement {
- imports {
- mavenBom "org.springframework.cloud:spring-cloud-dependencies:${releaseTrainVersion}"
- }
-}
-
-dependencies {
- compile "org.springframework.cloud:spring-cloud-sleuth-zipkin-stream"
- compile "org.springframework.cloud:spring-cloud-starter-sleuth"
- // Example for Rabbit binding
- compile "org.springframework.cloud:spring-cloud-stream-binder-rabbit"
-}
-
In order not to pick versions by yourself it’s much better if you add the dependency management via
-the Spring BOM
Add the dependency to spring-cloud-sleuth-zipkin-stream
Add the dependency to spring-cloud-starter-sleuth - that way all dependant dependencies will be downloaded
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);
- }
-
-}