Span initialSpan = this.tracer.nextSpan().name("span").start();
-foo.updateValue(initialSpan.context(), "1");
+COUNTRY_CODE.updateValue(initialSpan.context(), "FO");
bar.updateValue(initialSpan.context(), "2");
diff --git a/reference/html/README.html b/reference/html/README.html index 1aae7f7b4..35c54b179 100644 --- a/reference/html/README.html +++ b/reference/html/README.html @@ -705,7 +705,7 @@ In extreme cases, too much baggage can crash the application, due to exceeding t
Span initialSpan = this.tracer.nextSpan().name("span").start();
-foo.updateValue(initialSpan.context(), "1");
+COUNTRY_CODE.updateValue(initialSpan.context(), "FO");
bar.updateValue(initialSpan.context(), "2");
Unresolved directive in intro.adoc - include::/opt/jenkins/data/workspace/spring-cloud-jdk11-spring-cloud-sleuth-master-ci/spring-cloud-sleuth-core/src/test/resources/application-baggage.yml[indent=0]
+Unresolved directive in intro.adoc - include::/opt/jenkins/data/workspace/spring-cloud-sleuth-master-ci/spring-cloud-sleuth-core/src/test/resources/application-baggage.yml[indent=0]
Tags.BAGGAGE_FIELD.tag(foo, initialSpan);
+Tags.BAGGAGE_FIELD.tag(COUNTRY_CODE, initialSpan);
Tags.BAGGAGE_FIELD.tag(bar, initialSpan);
spring.sleuth.local-keys
Same as {@link #propagationKeys} except that this field is not propagated to remote services. @see brave.propagation.ExtraFieldPropagation.FactoryBuilder#addRedactedField(String)
Same as {@link #remoteKeys} except that this field is not propagated to remote services. @see brave.baggage.BaggagePropagationConfig.SingleBaggageField#local(BaggageField)
spring.sleuth.log.slf4j.enabled
spring.sleuth.propagation-keys
spring.sleuth.remote-keys
List of fields that are referenced the same in-process as it is on the wire. For example, the name "x-vcap-request-id" would be set as-is including the prefix. <p> Note: {@code fieldName} will be implicitly lower-cased. @see brave.propagation.ExtraFieldPropagation.FactoryBuilder#addField(String)
List of fields that are referenced the same in-process as it is on the wire. For example, the name "x-vcap-request-id" would be set as-is including the prefix. <p> Note: {@code fieldName} will be implicitly lower-cased. @see brave.baggage.BaggagePropagationConfig.SingleBaggageField#remote(BaggageField)
spring.sleuth.propagation.tag.enabled
Span initialSpan = this.tracer.nextSpan().name("span").start();
-foo.updateValue(initialSpan.context(), "1");
+COUNTRY_CODE.updateValue(initialSpan.context(), "FO");
bar.updateValue(initialSpan.context(), "2");
Unresolved directive in intro.adoc - include::/opt/jenkins/data/workspace/spring-cloud-jdk11-spring-cloud-sleuth-master-ci/spring-cloud-sleuth-core/src/test/resources/application-baggage.yml[indent=0]
+Unresolved directive in intro.adoc - include::/opt/jenkins/data/workspace/spring-cloud-sleuth-master-ci/spring-cloud-sleuth-core/src/test/resources/application-baggage.yml[indent=0]
Tags.BAGGAGE_FIELD.tag(foo, initialSpan);
+Tags.BAGGAGE_FIELD.tag(COUNTRY_CODE, initialSpan);
Tags.BAGGAGE_FIELD.tag(bar, initialSpan);
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 propagated to remote services without any prefix.
+You can also use the spring.sleuth.remote-keys property to pass a list of prefixed keys that are propagated to remote services without any prefix.
You can also use the spring.sleuth.local-keys property to pass a list keys that will be propagated locally but will not be propagated over the wire.
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 and propagation keys. E.g. spring.sleuth.log.slf4j.whitelisted-mdc-keys=foo will set the value of the foo baggage into MDC.
spring.sleuth.log.slf4j.whitelisted-mdc-keys=country-code will set the
+value of the country-code baggage into MDC.