From 2825ff05faf61903ef7e79d52807cd515d4129e8 Mon Sep 17 00:00:00 2001 From: buildmaster Date: Fri, 7 Sep 2018 12:38:15 +0000 Subject: [PATCH] Sync docs from master to gh-pages --- multi/multi__integrations.html | 3 +-- multi/multi__propagation.html | 9 +++++---- single/spring-cloud-sleuth.html | 12 ++++++------ spring-cloud-sleuth.xml | 15 ++++++--------- 4 files changed, 18 insertions(+), 21 deletions(-) diff --git a/multi/multi__integrations.html b/multi/multi__integrations.html index 33830237d..32a88f7b2 100644 --- a/multi/multi__integrations.html +++ b/multi/multi__integrations.html @@ -157,7 +157,6 @@ Decorating the Spring Integration Executor Channel with Tr it’s enough for you to register beans of types:

  • Propagation.Setter<MessageHeaderAccessor, String> - for writing headers to the message
  • Propagation.Getter<MessageHeaderAccessor, String> - for reading headers from the message

15.9.2 Spring RabbitMq

We instrument the RabbitTemplate so that tracing headers get injected into the message.

To block this feature, set spring.sleuth.messaging.rabbit.enabled to false.

15.9.3 Spring Kafka

We instrument the Spring Kafka’s ProducerFactory and ConsumerFactory so that tracing headers get injected into the created Spring Kafka’s -Producer and Consumer.

To block this feature, set spring.sleuth.messaging.kafka.enabled to false.

[Note]Note

We do not support context propagation via @KafkaListener annotation. -Check this issue for more information.

15.9.4 Spring JMS

We instrument the JmsTemplate so that tracing headers get injected +Producer and Consumer.

To block this feature, set spring.sleuth.messaging.kafka.enabled to false.

15.9.4 Spring JMS

We instrument the JmsTemplate so that tracing headers get injected into the message. We also support @JmsListener annotated methods on the consumer side.

To block this feature, set spring.sleuth.messaging.jms.enabled to false.

15.10 Zuul

We instrument the Zuul Ribbon integration by enriching the Ribbon requests with tracing information. To disable Zuul support, set the spring.sleuth.zuul.enabled property to false.

\ No newline at end of file diff --git a/multi/multi__propagation.html b/multi/multi__propagation.html index 224ce8262..bbf57d5c3 100644 --- a/multi/multi__propagation.html +++ b/multi/multi__propagation.html @@ -48,12 +48,13 @@ The following example shows how to propagate x-vcap-reques .addField("x-vcap-request-id") .addPrefixedFields("x-baggage-", Arrays.asList("country-code", "user-id")) .build() -);

Later, you can call the following code to affect the country code of the current trace context:

ExtraFieldPropagation.set("country-code", "FO");
-String countryCode = ExtraFieldPropagation.get("country-code");

Alternatively, if you have a reference to a trace context, you can use it explicitly, as shown in the following example:

ExtraFieldPropagation.set(span.context(), "country-code", "FO");
-String countryCode = ExtraFieldPropagation.get(span.context(), "country-code");
[Important]Important

A difference from previous versions of Sleuth is that, with Brave, you must pass the list of baggage keys. +);

Later, you can call the following code to affect the country code of the current trace context:

ExtraFieldPropagation.set("x-country-code", "FO");
+String countryCode = ExtraFieldPropagation.get("x-country-code");

Alternatively, if you have a reference to a trace context, you can use it explicitly, as shown in the following example:

ExtraFieldPropagation.set(span.context(), "x-country-code", "FO");
+String countryCode = ExtraFieldPropagation.get(span.context(), "x-country-code");
[Important]Important

A difference from previous versions of Sleuth is that, with Brave, you must pass the list of baggage keys. There are two properties to achieve this. With the spring.sleuth.baggage-keys, you set keys that get prefixed with baggage- for HTTP calls and baggage_ for messaging. -You can also use the spring.sleuth.propagation-keys property to pass a list of prefixed keys that are whitelisted without any prefix.

In order to automatically set the baggage values to Slf4j’s MDC, you have to set +You can also use the spring.sleuth.propagation-keys property to pass a list of prefixed keys that are whitelisted without any prefix. +Notice that there’s no x- in front of the header keys.

In order to automatically set the baggage values to Slf4j’s MDC, you have to set the spring.sleuth.log.slf4j.whitelisted-mdc-keys property with a list of whitelisted baggage keys. E.g. spring.sleuth.log.slf4j.whitelisted-mdc-keys=foo will set the value of the foo baggage into MDC.

5.1.2 Extracting a Propagated Context

The TraceContext.Extractor<C> reads trace identifiers and sampling status from an incoming request or message. diff --git a/single/spring-cloud-sleuth.html b/single/spring-cloud-sleuth.html index 81aff4f0a..ea4794655 100644 --- a/single/spring-cloud-sleuth.html +++ b/single/spring-cloud-sleuth.html @@ -451,12 +451,13 @@ The following example shows how to propagate x-vcap-reques .addField("x-vcap-request-id") .addPrefixedFields("x-baggage-", Arrays.asList("country-code", "user-id")) .build() -);

Later, you can call the following code to affect the country code of the current trace context:

ExtraFieldPropagation.set("country-code", "FO");
-String countryCode = ExtraFieldPropagation.get("country-code");

Alternatively, if you have a reference to a trace context, you can use it explicitly, as shown in the following example:

ExtraFieldPropagation.set(span.context(), "country-code", "FO");
-String countryCode = ExtraFieldPropagation.get(span.context(), "country-code");
[Important]Important

A difference from previous versions of Sleuth is that, with Brave, you must pass the list of baggage keys. +);

Later, you can call the following code to affect the country code of the current trace context:

ExtraFieldPropagation.set("x-country-code", "FO");
+String countryCode = ExtraFieldPropagation.get("x-country-code");

Alternatively, if you have a reference to a trace context, you can use it explicitly, as shown in the following example:

ExtraFieldPropagation.set(span.context(), "x-country-code", "FO");
+String countryCode = ExtraFieldPropagation.get(span.context(), "x-country-code");
[Important]Important

A difference from previous versions of Sleuth is that, with Brave, you must pass the list of baggage keys. There are two properties to achieve this. With the spring.sleuth.baggage-keys, you set keys that get prefixed with baggage- for HTTP calls and baggage_ for messaging. -You can also use the spring.sleuth.propagation-keys property to pass a list of prefixed keys that are whitelisted without any prefix.

In order to automatically set the baggage values to Slf4j’s MDC, you have to set +You can also use the spring.sleuth.propagation-keys property to pass a list of prefixed keys that are whitelisted without any prefix. +Notice that there’s no x- in front of the header keys.

In order to automatically set the baggage values to Slf4j’s MDC, you have to set the spring.sleuth.log.slf4j.whitelisted-mdc-keys property with a list of whitelisted baggage keys. E.g. spring.sleuth.log.slf4j.whitelisted-mdc-keys=foo will set the value of the foo baggage into MDC.

5.1.2 Extracting a Propagated Context

The TraceContext.Extractor<C> reads trace identifiers and sampling status from an incoming request or message. @@ -891,8 +892,7 @@ Decorating the Spring Integration Executor Channel with Tr it’s enough for you to register beans of types:

  • Propagation.Setter<MessageHeaderAccessor, String> - for writing headers to the message
  • Propagation.Getter<MessageHeaderAccessor, String> - for reading headers from the message

15.9.2 Spring RabbitMq

We instrument the RabbitTemplate so that tracing headers get injected into the message.

To block this feature, set spring.sleuth.messaging.rabbit.enabled to false.

15.9.3 Spring Kafka

We instrument the Spring Kafka’s ProducerFactory and ConsumerFactory so that tracing headers get injected into the created Spring Kafka’s -Producer and Consumer.

To block this feature, set spring.sleuth.messaging.kafka.enabled to false.

[Note]Note

We do not support context propagation via @KafkaListener annotation. -Check this issue for more information.

15.9.4 Spring JMS

We instrument the JmsTemplate so that tracing headers get injected +Producer and Consumer.

To block this feature, set spring.sleuth.messaging.kafka.enabled to false.

15.9.4 Spring JMS

We instrument the JmsTemplate so that tracing headers get injected into the message. We also support @JmsListener annotated methods on the consumer side.

To block this feature, set spring.sleuth.messaging.jms.enabled to false.

15.10 Zuul

We instrument the Zuul Ribbon integration by enriching the Ribbon requests with tracing information. To disable Zuul support, set the spring.sleuth.zuul.enabled property to false.

16. Running examples

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

  • Zipkin for apps presented in the samples to the top. First make diff --git a/spring-cloud-sleuth.xml b/spring-cloud-sleuth.xml index ed6a74519..27f07ad6e 100644 --- a/spring-cloud-sleuth.xml +++ b/spring-cloud-sleuth.xml @@ -1018,16 +1018,17 @@ The following example shows how to propagate x-vcap-request-id Later, you can call the following code to affect the country code of the current trace context: -ExtraFieldPropagation.set("country-code", "FO"); -String countryCode = ExtraFieldPropagation.get("country-code"); +ExtraFieldPropagation.set("x-country-code", "FO"); +String countryCode = ExtraFieldPropagation.get("x-country-code"); Alternatively, if you have a reference to a trace context, you can use it explicitly, as shown in the following example: -ExtraFieldPropagation.set(span.context(), "country-code", "FO"); -String countryCode = ExtraFieldPropagation.get(span.context(), "country-code"); +ExtraFieldPropagation.set(span.context(), "x-country-code", "FO"); +String countryCode = ExtraFieldPropagation.get(span.context(), "x-country-code"); A difference from previous versions of Sleuth is that, with Brave, you must pass the list of baggage keys. There are two properties to achieve this. With the spring.sleuth.baggage-keys, you set keys that get prefixed with baggage- for HTTP calls and baggage_ for messaging. -You can also use the spring.sleuth.propagation-keys property to pass a list of prefixed keys that are whitelisted without any prefix. +You can also use the spring.sleuth.propagation-keys property to pass a list of prefixed keys that are whitelisted without any prefix. +Notice that there’s no x- in front of the header keys. In order to automatically set the baggage values to Slf4j’s MDC, you have to set the spring.sleuth.log.slf4j.whitelisted-mdc-keys property with a list of whitelisted @@ -1954,10 +1955,6 @@ into the message. so that tracing headers get injected into the created Spring Kafka’s Producer and Consumer. To block this feature, set spring.sleuth.messaging.kafka.enabled to false. - -We do not support context propagation via @KafkaListener annotation. -Check this issue for more information. -
    Spring JMS