diff --git a/1.3.x/multi/multi__integrations.html b/1.3.x/multi/multi__integrations.html index 6f1b580fe..6f473dc2e 100644 --- a/1.3.x/multi/multi__integrations.html +++ b/1.3.x/multi/multi__integrations.html @@ -159,4 +159,27 @@ subscribe events. To disable Spring Integration instrumentation, set
[Important]Important

When using the Executor to build a Spring Integration IntegrationFlow remember to use the untraced version of the Executor. Decorating Spring Integration Executor Channel with TraceableExecutorService will cause the spans to be improperly closed.

13.9 Zuul

We’re registering Zuul filters to propagate the tracing information (the request header is enriched with tracing data). -To disable Zuul support set the spring.sleuth.zuul.enabled property to false.

\ No newline at end of file +To disable Zuul support set the spring.sleuth.zuul.enabled property to false.

13.10 Spring Cloud Function

Sleuth works out of the box with Spring Cloud Function. Since functions +might be short living, it’s best to make the Zipkin span reporting synchronous. +Just define a Reporter<Span> bean as presented below:

@Configuration
+class ReporterConfiguration {
+	@Bean
+	public Reporter<Span> reporter(
+			SpanMetricReporter spanMetricReporter,
+			ZipkinProperties zipkin,
+			Sender sender
+	) {
+		final AsyncReporter<Span> reporter = AsyncReporter.builder(sender)
+				.queuedMaxSpans(1000)
+				.messageTimeout(zipkin.getMessageTimeout(), TimeUnit.SECONDS)
+				.metrics(new ReporterMetricsAdapter(spanMetricReporter))
+				.build(zipkin.getEncoder());
+		return new Reporter<Span>() {
+			@Override public void report(Span span) {
+				reporter.report(span);
+				// make the reporter synchronous
+				reporter.flush();
+			}
+		};
+	}
+}
\ No newline at end of file diff --git a/1.3.x/multi/multi_spring-cloud-sleuth.html b/1.3.x/multi/multi_spring-cloud-sleuth.html index d213c1809..80963ca30 100644 --- a/1.3.x/multi/multi_spring-cloud-sleuth.html +++ b/1.3.x/multi/multi_spring-cloud-sleuth.html @@ -1,3 +1,3 @@ - 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
14. Running examples
\ No newline at end of file + 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
\ No newline at end of file diff --git a/1.3.x/single/spring-cloud-sleuth.html b/1.3.x/single/spring-cloud-sleuth.html index 8ce78ce46..77a320fb8 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
14. Running examples

1.3.3.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.3.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 @@ -805,4 +805,27 @@ subscribe events. To disable Spring Integration instrumentation, set

[Important]Important

When using the Executor to build a Spring Integration IntegrationFlow remember to use the untraced version of the Executor. Decorating Spring Integration Executor Channel with TraceableExecutorService will cause the spans to be improperly closed.

13.9 Zuul

We’re registering Zuul filters to propagate the tracing information (the request header is enriched with tracing data). -To disable Zuul support set the spring.sleuth.zuul.enabled property to false.

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 +To disable Zuul support set the spring.sleuth.zuul.enabled property to false.

13.10 Spring Cloud Function

Sleuth works out of the box with Spring Cloud Function. Since functions +might be short living, it’s best to make the Zipkin span reporting synchronous. +Just define a Reporter<Span> bean as presented below:

@Configuration
+class ReporterConfiguration {
+	@Bean
+	public Reporter<Span> reporter(
+			SpanMetricReporter spanMetricReporter,
+			ZipkinProperties zipkin,
+			Sender sender
+	) {
+		final AsyncReporter<Span> reporter = AsyncReporter.builder(sender)
+				.queuedMaxSpans(1000)
+				.messageTimeout(zipkin.getMessageTimeout(), TimeUnit.SECONDS)
+				.metrics(new ReporterMetricsAdapter(spanMetricReporter))
+				.build(zipkin.getEncoder());
+		return new Reporter<Span>() {
+			@Override public void report(Span span) {
+				reporter.report(span);
+				// make the reporter synchronous
+				reporter.flush();
+			}
+		};
+	}
+}

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 8c70b0846..b9d80bf12 100644 --- a/1.3.x/spring-cloud-sleuth.xml +++ b/1.3.x/spring-cloud-sleuth.xml @@ -1718,6 +1718,34 @@ Decorating Spring Integration Executor Channel with TraceableExecutorSe We’re registering Zuul filters to propagate the tracing information (the request header is enriched with tracing data). To disable Zuul support set the spring.sleuth.zuul.enabled property to false. +
+Spring Cloud Function +Sleuth works out of the box with Spring Cloud Function. Since functions +might be short living, it’s best to make the Zipkin span reporting synchronous. +Just define a Reporter<Span> bean as presented below: +@Configuration +class ReporterConfiguration { + @Bean + public Reporter<Span> reporter( + SpanMetricReporter spanMetricReporter, + ZipkinProperties zipkin, + Sender sender + ) { + final AsyncReporter<Span> reporter = AsyncReporter.builder(sender) + .queuedMaxSpans(1000) + .messageTimeout(zipkin.getMessageTimeout(), TimeUnit.SECONDS) + .metrics(new ReporterMetricsAdapter(spanMetricReporter)) + .build(zipkin.getEncoder()); + return new Reporter<Span>() { + @Override public void report(Span span) { + reporter.report(span); + // make the reporter synchronous + reporter.flush(); + } + }; + } +} +
Running examples