diff --git a/1.3.x/multi/multi__integrations.html b/1.3.x/multi/multi__integrations.html index 6f473dc2e..075c312be 100644 --- a/1.3.x/multi/multi__integrations.html +++ b/1.3.x/multi/multi__integrations.html @@ -113,7 +113,7 @@ can see an example of how to set up such a custom AsyncRes //CUSTOMIZE HERE return factory; } -}

13.5.3 Traverson

If you’re using the Traverson library +}

13.5.3 Traverson

If you’re using the Traverson library it’s enough for you to inject a RestTemplate as a bean into your Traverson object. Since RestTemplate is already intercepted, you will get full support of tracing in your client. Below you can find a pseudo code of how to do that:

@Autowired RestTemplate restTemplate;
@@ -154,7 +154,7 @@ can see an example of how to set up such a custom Executor
 		executor.initialize();
 		return new LazyTraceExecutor(this.beanFactory, executor);
 	}
-}

13.8 Messaging

Spring Cloud Sleuth integrates with Spring Integration. It creates spans for publish and +}

13.8 Messaging

Spring Cloud Sleuth integrates with Spring Integration. It creates spans for publish and subscribe events. To disable Spring Integration instrumentation, set spring.sleuth.integration.enabled to false.

You can provide the spring.sleuth.integration.patterns pattern to explicitly provide the names of channels that you want to include for tracing. By default all channels are included.

[Important]Important

When using the Executor to build a Spring Integration IntegrationFlow remember to use the untraced version of the Executor. diff --git a/1.3.x/multi/multi__introduction.html b/1.3.x/multi/multi__introduction.html index 0e1416cb8..aebd216c7 100644 --- a/1.3.x/multi/multi__introduction.html +++ b/1.3.x/multi/multi__introduction.html @@ -1,6 +1,6 @@ - 1. Introduction

1. Introduction

Spring Cloud Sleuth implements a distributed tracing solution for Spring Cloud.

1.1 Terminology

Spring Cloud Sleuth borrows Dapper’s terminology.

Span: The basic unit of work. For example, sending an RPC is a new span, as is sending a response to an + 1. Introduction

1. Introduction

Spring Cloud Sleuth implements a distributed tracing solution for Spring Cloud.

1.1 Terminology

Spring Cloud Sleuth borrows Dapper’s terminology.

Span: The basic unit of work. For example, sending an RPC is a new span, as is sending a response to an RPC. Span’s are identified by a unique 64-bit ID for the span and another 64-bit ID for the trace the span is a part of. Spans also have other data, such as descriptions, timestamped events, key-value annotations (tags), the ID of the span that caused them, and process ID’s (normally IP address).

Spans are started and stopped, and they keep track of their timing information. Once you create a @@ -34,7 +34,7 @@ service2.log:2016-02-26 11:15:47.924 INFO [service2,2485ec27856c56f4,9aa10ee6fb service4.log:2016-02-26 11:15:48.134 INFO [service4,2485ec27856c56f4,1b1845262ffba49d,true] 68061 --- [nio-8084-exec-1] i.s.c.sleuth.docs.service4.Application : Hello from service4 service2.log:2016-02-26 11:15:48.156 INFO [service2,2485ec27856c56f4,9aa10ee6fbde75fa,true] 68059 --- [nio-8082-exec-1] i.s.c.sleuth.docs.service2.Application : Got response from service4 [Hello from service4] service1.log:2016-02-26 11:15:48.182 INFO [service1,2485ec27856c56f4,2485ec27856c56f4,true] 68058 --- [nio-8081-exec-1] i.s.c.sleuth.docs.service1.Application : Got response from service2 [Hello from service2, response from service3 [Hello from service3] and from service4 [Hello from service4]]

If you’re using a log aggregating tool like Kibana, -Splunk etc. you can order the events that took place. An example of +Splunk etc. you can order the events that took place. An example of Kibana would look like this:

Log correlation with Kibana

If you want to use Logstash here is the Grok pattern for Logstash:

filter {
        # pattern matching logback pattern
        grok {
diff --git a/1.3.x/multi/multi__metrics.html b/1.3.x/multi/multi__metrics.html
index a3ae473fa..911b23b25 100644
--- a/1.3.x/multi/multi__metrics.html
+++ b/1.3.x/multi/multi__metrics.html
@@ -1,7 +1,7 @@
 
       
    12. Metrics

12. Metrics

Currently Spring Cloud Sleuth registers very simple metrics related to spans. -It’s using the Spring Boot’s metrics support +It’s using the Spring Boot’s metrics support to calculate the number of accepted and dropped spans. Each time a span gets sent to Zipkin the number of accepted spans will increase. If there’s an error then the number of dropped spans will get increased.

\ No newline at end of file diff --git a/1.3.x/multi/multi__running_examples.html b/1.3.x/multi/multi__running_examples.html index ca327869e..c99e61fc3 100644 --- a/1.3.x/multi/multi__running_examples.html +++ b/1.3.x/multi/multi__running_examples.html @@ -1,3 +1,3 @@ - 14. Running examples

14. Running examples

You can find the running examples deployed in the Pivotal Web Services. Check them out in the following links:

\ No newline at end of file + 14. Running examples

14. Running examples

You can find the running examples deployed in the Pivotal Web Services. Check them out in the following links:

\ No newline at end of file diff --git a/1.3.x/multi/multi__sending_spans_to_zipkin.html b/1.3.x/multi/multi__sending_spans_to_zipkin.html index e9ea6b36b..f78f815a4 100644 --- a/1.3.x/multi/multi__sending_spans_to_zipkin.html +++ b/1.3.x/multi/multi__sending_spans_to_zipkin.html @@ -6,7 +6,7 @@ By default it sends them via HTTP to a Zipkin server on localhost (port 9411). I on spring-rabbit or spring-kafka your app will send traces to a broker instead of http.

By default if you add spring-cloud-starter-zipkin as a dependency to your project, when the span is closed, it will be sent to Zipkin over HTTP. The communication is asynchronous. You can configure the URL by setting the spring.zipkin.baseUrl -property as follows:

spring.zipkin.baseUrl: http://192.168.99.100:9411/

If you want to find Zipkin via service discovery it’s enough to pass the +property as follows:

spring.zipkin.baseUrl: https://192.168.99.100:9411/

If you want to find Zipkin via service discovery it’s enough to pass the Zipkin’s service id inside the URL. If you want to disable this feature just set spring.zipkin.discoveryClientEnabled to false. Example for `zipkinserver service id:

spring.zipkin.baseUrl: http://zipkinserver/

When this Discovery Client feature is enabled, Sleuth uses diff --git a/1.3.x/multi/multi__span_data_as_messages.html b/1.3.x/multi/multi__span_data_as_messages.html index 6fdedfa0b..f41490a46 100644 --- a/1.3.x/multi/multi__span_data_as_messages.html +++ b/1.3.x/multi/multi__span_data_as_messages.html @@ -1,7 +1,7 @@ 11. Span Data as Messages

11. Span Data as Messages

You can accumulate and send span data over -Spring Cloud Stream by +Spring Cloud Stream by including the spring-cloud-sleuth-stream jar as a dependency, and adding a Channel Binder implementation (e.g. spring-cloud-starter-stream-rabbit for RabbitMQ or diff --git a/1.3.x/single/spring-cloud-sleuth.html b/1.3.x/single/spring-cloud-sleuth.html index 9b53c6211..1131a2bb4 100644 --- a/1.3.x/single/spring-cloud-sleuth.html +++ b/1.3.x/single/spring-cloud-sleuth.html @@ -1,6 +1,6 @@ - Spring Cloud Sleuth

Spring Cloud Sleuth

Adrian Cole, Spencer Gibb, Marcin Grzejszczak, Dave Syer

Table of Contents

1. Introduction
1.1. Terminology
1.2. Purpose
1.2.1. Distributed tracing with Zipkin
1.2.2. Visualizing errors
1.2.3. Live examples
1.2.4. Log correlation
JSON Logback with Logstash
1.2.5. Propagating Span Context
Baggage vs. Span Tags
1.3. Adding to the project
1.3.1. Only Sleuth (log correlation)
1.3.2. Sleuth with Zipkin via HTTP
1.3.3. Sleuth with Zipkin via RabbitMQ or Kafka
2. Additional resources
3. Features
4. Sampling
5. Instrumentation
6. Span lifecycle
6.1. Creating and closing spans
6.2. Continuing spans
6.3. Creating spans with an explicit parent
7. Naming spans
7.1. @SpanName annotation
7.2. toString() method
8. Managing spans with annotations
8.1. Rationale
8.2. Creating new spans
8.3. Continuing spans
8.4. More advanced tag setting
8.4.1. Custom extractor
8.4.2. Resolving expressions for value
8.4.3. Using toString method
9. Customizations
9.1. Spring Integration
9.2. HTTP
9.3. Example
9.4. TraceFilter
9.5. Custom SA tag in Zipkin
9.6. Custom service name
9.7. Customization of reported spans
9.8. Host locator
10. Sending spans to Zipkin
11. Span Data as Messages
11.1. Zipkin Consumer
11.2. Custom Consumer
12. Metrics
13. Integrations
13.1. Runnable and Callable
13.2. Hystrix
13.2.1. Custom Concurrency Strategy
13.2.2. Manual Command setting
13.3. RxJava
13.4. HTTP integration
13.4.1. HTTP Filter
13.4.2. HandlerInterceptor
13.4.3. Async Servlet support
13.5. HTTP client integration
13.5.1. Synchronous Rest Template
13.5.2. Asynchronous Rest Template
Multiple Asynchronous Rest Templates
13.5.3. Traverson
13.6. Feign
13.7. Asynchronous communication
13.7.1. @Async annotated methods
13.7.2. @Scheduled annotated methods
13.7.3. Executor, ExecutorService and ScheduledExecutorService
Customization of Executors
13.8. Messaging
13.9. Zuul
13.10. Spring Cloud Function
14. Running examples

1.3.6.BUILD-SNAPSHOT

1. Introduction

Spring Cloud Sleuth implements a distributed tracing solution for Spring Cloud.

1.1 Terminology

Spring Cloud Sleuth borrows Dapper’s terminology.

Span: The basic unit of work. For example, sending an RPC is a new span, as is sending a response to an + Spring Cloud Sleuth

Spring Cloud Sleuth

Adrian Cole, Spencer Gibb, Marcin Grzejszczak, Dave Syer

Table of Contents

1. Introduction
1.1. Terminology
1.2. Purpose
1.2.1. Distributed tracing with Zipkin
1.2.2. Visualizing errors
1.2.3. Live examples
1.2.4. Log correlation
JSON Logback with Logstash
1.2.5. Propagating Span Context
Baggage vs. Span Tags
1.3. Adding to the project
1.3.1. Only Sleuth (log correlation)
1.3.2. Sleuth with Zipkin via HTTP
1.3.3. Sleuth with Zipkin via RabbitMQ or Kafka
2. Additional resources
3. Features
4. Sampling
5. Instrumentation
6. Span lifecycle
6.1. Creating and closing spans
6.2. Continuing spans
6.3. Creating spans with an explicit parent
7. Naming spans
7.1. @SpanName annotation
7.2. toString() method
8. Managing spans with annotations
8.1. Rationale
8.2. Creating new spans
8.3. Continuing spans
8.4. More advanced tag setting
8.4.1. Custom extractor
8.4.2. Resolving expressions for value
8.4.3. Using toString method
9. Customizations
9.1. Spring Integration
9.2. HTTP
9.3. Example
9.4. TraceFilter
9.5. Custom SA tag in Zipkin
9.6. Custom service name
9.7. Customization of reported spans
9.8. Host locator
10. Sending spans to Zipkin
11. Span Data as Messages
11.1. Zipkin Consumer
11.2. Custom Consumer
12. Metrics
13. Integrations
13.1. Runnable and Callable
13.2. Hystrix
13.2.1. Custom Concurrency Strategy
13.2.2. Manual Command setting
13.3. RxJava
13.4. HTTP integration
13.4.1. HTTP Filter
13.4.2. HandlerInterceptor
13.4.3. Async Servlet support
13.5. HTTP client integration
13.5.1. Synchronous Rest Template
13.5.2. Asynchronous Rest Template
Multiple Asynchronous Rest Templates
13.5.3. Traverson
13.6. Feign
13.7. Asynchronous communication
13.7.1. @Async annotated methods
13.7.2. @Scheduled annotated methods
13.7.3. Executor, ExecutorService and ScheduledExecutorService
Customization of Executors
13.8. Messaging
13.9. Zuul
13.10. Spring Cloud Function
14. Running examples

1.3.6.BUILD-SNAPSHOT

1. Introduction

Spring Cloud Sleuth implements a distributed tracing solution for Spring Cloud.

1.1 Terminology

Spring Cloud Sleuth borrows Dapper’s terminology.

Span: The basic unit of work. For example, sending an RPC is a new span, as is sending a response to an RPC. Span’s are identified by a unique 64-bit ID for the span and another 64-bit ID for the trace the span is a part of. Spans also have other data, such as descriptions, timestamped events, key-value annotations (tags), the ID of the span that caused them, and process ID’s (normally IP address).

Spans are started and stopped, and they keep track of their timing information. Once you create a @@ -34,7 +34,7 @@ service2.log:2016-02-26 11:15:47.924 INFO [service2,2485ec27856c56f4,9aa10ee6fb service4.log:2016-02-26 11:15:48.134 INFO [service4,2485ec27856c56f4,1b1845262ffba49d,true] 68061 --- [nio-8084-exec-1] i.s.c.sleuth.docs.service4.Application : Hello from service4 service2.log:2016-02-26 11:15:48.156 INFO [service2,2485ec27856c56f4,9aa10ee6fbde75fa,true] 68059 --- [nio-8082-exec-1] i.s.c.sleuth.docs.service2.Application : Got response from service4 [Hello from service4] service1.log:2016-02-26 11:15:48.182 INFO [service1,2485ec27856c56f4,2485ec27856c56f4,true] 68058 --- [nio-8081-exec-1] i.s.c.sleuth.docs.service1.Application : Got response from service2 [Hello from service2, response from service3 [Hello from service3] and from service4 [Hello from service4]]

If you’re using a log aggregating tool like Kibana, -Splunk etc. you can order the events that took place. An example of +Splunk etc. you can order the events that took place. An example of Kibana would look like this:

Log correlation with Kibana

If you want to use Logstash here is the Grok pattern for Logstash:

filter {
        # pattern matching logback pattern
        grok {
@@ -576,7 +576,7 @@ By default it sends them via HTTP to a Zipkin server on localhost (port 9411). I
 on spring-rabbit or spring-kafka your app will send traces to a broker instead of http.

By default if you add spring-cloud-starter-zipkin as a dependency to your project, when the span is closed, it will be sent to Zipkin over HTTP. The communication is asynchronous. You can configure the URL by setting the spring.zipkin.baseUrl -property as follows:

spring.zipkin.baseUrl: http://192.168.99.100:9411/

If you want to find Zipkin via service discovery it’s enough to pass the +property as follows:

spring.zipkin.baseUrl: https://192.168.99.100:9411/

If you want to find Zipkin via service discovery it’s enough to pass the Zipkin’s service id inside the URL. If you want to disable this feature just set spring.zipkin.discoveryClientEnabled to false. Example for `zipkinserver service id:

spring.zipkin.baseUrl: http://zipkinserver/

When this Discovery Client feature is enabled, Sleuth uses @@ -604,7 +604,7 @@ object, you will have to create a bean of zipkin2.reporter zipkinRestTemplateCustomizer.customize(restTemplate); return myCustomSender(zipkin, restTemplate); }

11. Span Data as Messages

You can accumulate and send span data over -Spring Cloud Stream by +Spring Cloud Stream by including the spring-cloud-sleuth-stream jar as a dependency, and adding a Channel Binder implementation (e.g. spring-cloud-starter-stream-rabbit for RabbitMQ or @@ -673,7 +673,7 @@ with name equal to StreamSpanReporter.POLLER. Here return poller; } }

12. Metrics

Currently Spring Cloud Sleuth registers very simple metrics related to spans. -It’s using the Spring Boot’s metrics support +It’s using the Spring Boot’s metrics support to calculate the number of accepted and dropped spans. Each time a span gets sent to Zipkin the number of accepted spans will increase. If there’s an error then the number of dropped spans will get increased.

13. Integrations

13.1 Runnable and Callable

If you’re wrapping your logic in Runnable or Callable it’s enough to wrap those classes in their Sleuth representative.

Example for Runnable:

Runnable runnable = new Runnable() {
@@ -789,7 +789,7 @@ can see an example of how to set up such a custom AsyncRes
 		//CUSTOMIZE HERE
 		return factory;
 	}
-}

13.5.3 Traverson

If you’re using the Traverson library +}

13.5.3 Traverson

If you’re using the Traverson library it’s enough for you to inject a RestTemplate as a bean into your Traverson object. Since RestTemplate is already intercepted, you will get full support of tracing in your client. Below you can find a pseudo code of how to do that:

@Autowired RestTemplate restTemplate;
@@ -830,7 +830,7 @@ can see an example of how to set up such a custom Executor
 		executor.initialize();
 		return new LazyTraceExecutor(this.beanFactory, executor);
 	}
-}

13.8 Messaging

Spring Cloud Sleuth integrates with Spring Integration. It creates spans for publish and +}

13.8 Messaging

Spring Cloud Sleuth integrates with Spring Integration. It creates spans for publish and subscribe events. To disable Spring Integration instrumentation, set spring.sleuth.integration.enabled to false.

You can provide the spring.sleuth.integration.patterns pattern to explicitly provide the names of channels that you want to include for tracing. By default all channels are included.

[Important]Important

When using the Executor to build a Spring Integration IntegrationFlow remember to use the untraced version of the Executor. @@ -858,4 +858,4 @@ Just define a Reporter<Span> bean as presente } }; } -}

14. Running examples

You can find the running examples deployed in the Pivotal Web Services. Check them out in the following links:

\ No newline at end of file +}

14. Running examples

You can find the running examples deployed in the Pivotal Web Services. Check them out in the following links:

\ No newline at end of file diff --git a/1.3.x/spring-cloud-sleuth.xml b/1.3.x/spring-cloud-sleuth.xml index 24076c256..bf18fb615 100644 --- a/1.3.x/spring-cloud-sleuth.xml +++ b/1.3.x/spring-cloud-sleuth.xml @@ -18,10 +18,10 @@ Introduction -Spring Cloud Sleuth implements a distributed tracing solution for Spring Cloud. +Spring Cloud Sleuth implements a distributed tracing solution for Spring Cloud.
Terminology -Spring Cloud Sleuth borrows Dapper’s terminology. +Spring Cloud Sleuth borrows Dapper’s terminology. Span: The basic unit of work. For example, sending an RPC is a new span, as is sending a response to an RPC. Span’s are identified by a unique 64-bit ID for the span and another 64-bit ID for the trace the span is a part of. Spans also have other data, such as descriptions, timestamped events, key-value @@ -200,7 +200,7 @@ service4.log:2016-02-26 11:15:48.134 INFO [service4,2485ec27856c56f4,1b1845262f service2.log:2016-02-26 11:15:48.156 INFO [service2,2485ec27856c56f4,9aa10ee6fbde75fa,true] 68059 --- [nio-8082-exec-1] i.s.c.sleuth.docs.service2.Application : Got response from service4 [Hello from service4] service1.log:2016-02-26 11:15:48.182 INFO [service1,2485ec27856c56f4,2485ec27856c56f4,true] 68058 --- [nio-8081-exec-1] i.s.c.sleuth.docs.service1.Application : Got response from service2 [Hello from service2, response from service3 [Hello from service3] and from service4 [Hello from service4]] If you’re using a log aggregating tool like Kibana, -Splunk etc. you can order the events that took place. An example of +Splunk etc. you can order the events that took place. An example of Kibana would look like this: @@ -1309,7 +1309,7 @@ on spring-rabbit or spring-kafka your app when the span is closed, it will be sent to Zipkin over HTTP. The communication is asynchronous. You can configure the URL by setting the spring.zipkin.baseUrl property as follows: -spring.zipkin.baseUrl: http://192.168.99.100:9411/ +spring.zipkin.baseUrl: https://192.168.99.100:9411/ If you want to find Zipkin via service discovery it’s enough to pass the Zipkin’s service id inside the URL. If you want to disable this feature just set spring.zipkin.discoveryClientEnabled to false. @@ -1351,7 +1351,7 @@ object, you will have to create a bean of zipkin2.reporter.Sender Span Data as Messages You can accumulate and send span data over -Spring Cloud Stream by +Spring Cloud Stream by including the spring-cloud-sleuth-stream jar as a dependency, and adding a Channel Binder implementation (e.g. spring-cloud-starter-stream-rabbit for RabbitMQ or @@ -1450,7 +1450,7 @@ public static class CustomPollerConfiguration { Metrics Currently Spring Cloud Sleuth registers very simple metrics related to spans. -It’s using the Spring Boot’s metrics support +It’s using the Spring Boot’s metrics support to calculate the number of accepted and dropped spans. Each time a span gets sent to Zipkin the number of accepted spans will increase. If there’s an error then the number of dropped spans will get increased. @@ -1639,7 +1639,7 @@ static class Config {
Traverson -If you’re using the Traverson library +If you’re using the Traverson library it’s enough for you to inject a RestTemplate as a bean into your Traverson object. Since RestTemplate is already intercepted, you will get full support of tracing in your client. Below you can find a pseudo code of how to do that: @@ -1741,7 +1741,7 @@ static class CustomExecutorConfig extends AsyncConfigurerSupport {
Messaging -Spring Cloud Sleuth integrates with Spring Integration. It creates spans for publish and +Spring Cloud Sleuth integrates with Spring Integration. It creates spans for publish and subscribe events. To disable Spring Integration instrumentation, set spring.sleuth.integration.enabled to false. You can provide the spring.sleuth.integration.patterns pattern to explicitly provide the names of channels that you want to include for tracing. By default all channels @@ -1790,10 +1790,10 @@ class ReporterConfiguration { You can find the running examples deployed in the Pivotal Web Services. Check them out in the following links: -Zipkin for apps presented in the samples to the top +Zipkin for apps presented in the samples to the top -Zipkin for Brewery on PWS, its Github Code +Zipkin for Brewery on PWS, its Github Code