From 826f446d45225a046f3b3dfc5fe641a5fb0de337 Mon Sep 17 00:00:00 2001 From: buildmaster Date: Wed, 4 Apr 2018 15:13:21 +0000 Subject: [PATCH] Sync docs from master to gh-pages --- multi/multi__sending_spans_to_zipkin.html | 19 ++++++++++++++++++- single/spring-cloud-sleuth.html | 19 ++++++++++++++++++- spring-cloud-sleuth.xml | 21 +++++++++++++++++++++ 3 files changed, 57 insertions(+), 2 deletions(-) diff --git a/multi/multi__sending_spans_to_zipkin.html b/multi/multi__sending_spans_to_zipkin.html index e586dcbd6..59838837e 100644 --- a/multi/multi__sending_spans_to_zipkin.html +++ b/multi/multi__sending_spans_to_zipkin.html @@ -8,4 +8,21 @@ that you can set up the load balancing configuration e.g. via Ribbon.

  ribbon:
     ListOfServers: host1,host2

If you have web, rabbit, or kafka together on the classpath, you might need to pick the means by which you would like to send spans to zipkin. To do so, set web, rabbit, or kafka to the spring.zipkin.sender.type property. -The following example shows setting the sender type for web:

spring.zipkin.sender.type: web
\ No newline at end of file +The following example shows setting the sender type for web:

spring.zipkin.sender.type: web

To customize the RestTemplate that sends spans to Zipkin via HTTP, you can register +the ZipkinRestTemplateCustomizer bean.

@Configuration
+class MyConfig {
+	@Bean ZipkinRestTemplateCustomizer myCustomizer() {
+		return new ZipkinRestTemplateCustomizer() {
+			@Override
+			void customize(RestTemplate restTemplate) {
+				// customize the RestTemplate
+			}
+		};
+	}
+}

If, however, you would like to control the full process of creating the RestTemplate +object, you will have to create a bean of zipkin2.reporter.Sender type.

	@Bean Sender myRestTemplateSender(ZipkinProperties zipkin,
+			ZipkinRestTemplateCustomizer zipkinRestTemplateCustomizer) {
+		RestTemplate restTemplate = mySuperCustomRestTemplate();
+		zipkinRestTemplateCustomizer.customize(restTemplate);
+		return new RestTemplateSender(restTemplate, zipkin.getBaseUrl(), zipkin.getEncoder());
+	}
\ No newline at end of file diff --git a/single/spring-cloud-sleuth.html b/single/spring-cloud-sleuth.html index d85d5d77e..fbb7b885d 100644 --- a/single/spring-cloud-sleuth.html +++ b/single/spring-cloud-sleuth.html @@ -670,7 +670,24 @@ that you can set up the load balancing configuration e.g. via Ribbon.

  ribbon:
     ListOfServers: host1,host2

If you have web, rabbit, or kafka together on the classpath, you might need to pick the means by which you would like to send spans to zipkin. To do so, set web, rabbit, or kafka to the spring.zipkin.sender.type property. -The following example shows setting the sender type for web:

spring.zipkin.sender.type: web

14. Zipkin Stream Span Consumer

[Important]Important

We recommend using Zipkin’s native support for message-based span sending. +The following example shows setting the sender type for web:

spring.zipkin.sender.type: web

To customize the RestTemplate that sends spans to Zipkin via HTTP, you can register +the ZipkinRestTemplateCustomizer bean.

@Configuration
+class MyConfig {
+	@Bean ZipkinRestTemplateCustomizer myCustomizer() {
+		return new ZipkinRestTemplateCustomizer() {
+			@Override
+			void customize(RestTemplate restTemplate) {
+				// customize the RestTemplate
+			}
+		};
+	}
+}

If, however, you would like to control the full process of creating the RestTemplate +object, you will have to create a bean of zipkin2.reporter.Sender type.

	@Bean Sender myRestTemplateSender(ZipkinProperties zipkin,
+			ZipkinRestTemplateCustomizer zipkinRestTemplateCustomizer) {
+		RestTemplate restTemplate = mySuperCustomRestTemplate();
+		zipkinRestTemplateCustomizer.customize(restTemplate);
+		return new RestTemplateSender(restTemplate, zipkin.getBaseUrl(), zipkin.getEncoder());
+	}

14. Zipkin Stream Span Consumer

[Important]Important

We recommend using Zipkin’s native support for message-based span sending. Starting from the Edgware release, the Zipkin Stream server is deprecated. In the Finchley release, it got removed.

See the Dalston Documentaion for how to create a Stream Zipkin server.

15. Integrations

15.1 OpenTracing

Spring Cloud Sleuth is compatible with OpenTracing. diff --git a/spring-cloud-sleuth.xml b/spring-cloud-sleuth.xml index ba1eecb0a..c02374e08 100644 --- a/spring-cloud-sleuth.xml +++ b/spring-cloud-sleuth.xml @@ -1502,6 +1502,27 @@ that you can set up the load balancing configuration e.g. via Ribbon. To do so, set web, rabbit, or kafka to the spring.zipkin.sender.type property. The following example shows setting the sender type for web: spring.zipkin.sender.type: web +To customize the RestTemplate that sends spans to Zipkin via HTTP, you can register +the ZipkinRestTemplateCustomizer bean. +@Configuration +class MyConfig { + @Bean ZipkinRestTemplateCustomizer myCustomizer() { + return new ZipkinRestTemplateCustomizer() { + @Override + void customize(RestTemplate restTemplate) { + // customize the RestTemplate + } + }; + } +} +If, however, you would like to control the full process of creating the RestTemplate +object, you will have to create a bean of zipkin2.reporter.Sender type. + @Bean Sender myRestTemplateSender(ZipkinProperties zipkin, + ZipkinRestTemplateCustomizer zipkinRestTemplateCustomizer) { + RestTemplate restTemplate = mySuperCustomRestTemplate(); + zipkinRestTemplateCustomizer.customize(restTemplate); + return new RestTemplateSender(restTemplate, zipkin.getBaseUrl(), zipkin.getEncoder()); + } Zipkin Stream Span Consumer