Span initialSpan = this.tracer.nextSpan().name("span").start();
-COUNTRY_CODE.updateValue(initialSpan.context(), "FO");
-bar.updateValue(initialSpan.context(), "2");
+BUSINESS_PROCESS.updateValue(initialSpan.context(), "ALM");
+COUNTRY_CODE.updateValue(initialSpan.context(), "FO");
-
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.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.
+
Baggage are fields that are propagated with the trace, optionally out of process. You can use
+properties to define fields that have no special configuration such as name mapping:
+
+
+
+
No prefixing applies with these keys. What you set is literally what is used.
+
+
+
A name set in either of these properties will result in a BaggageField of the same name.
In order to automatically set the baggage values to Slf4j’s MDC, you have to set
@@ -1373,6 +1390,15 @@ Remember that adding entries to MDC can drastically decrease the performance of
If you want to add the baggage entries as tags, to make it possible to search for spans via the baggage entries, you can set the value of
spring.sleuth.propagation.tag.whitelisted-keys with a list of whitelisted baggage keys. To disable the feature you have to pass the spring.sleuth.propagation.tag.enabled=false property.
+
+
+
+
If you need to do anything more advanced than above, do not define properties and instead use a
+@Bean config for the baggage fields you use.
+ * SingleBaggageField controls header names for one BaggageField.
+ * SingleCorrelationField controls the MDC name of one BaggageField, and whether updates flush.
+
+
diff --git a/reference/html/intro.html b/reference/html/intro.html
index 72bfefdfe..3fb5e8410 100644
--- a/reference/html/intro.html
+++ b/reference/html/intro.html
@@ -605,8 +605,8 @@ In extreme cases, too much baggage can crash the application, due to exceeding t
Span initialSpan = this.tracer.nextSpan().name("span").start();
-COUNTRY_CODE.updateValue(initialSpan.context(), "FO");
-bar.updateValue(initialSpan.context(), "2");
+BUSINESS_PROCESS.updateValue(initialSpan.context(), "ALM");
+COUNTRY_CODE.updateValue(initialSpan.context(), "FO");
@@ -653,14 +653,13 @@ The span must be in scope.
The setup
-
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]
The code
-
Tags.BAGGAGE_FIELD.tag(COUNTRY_CODE, initialSpan);
-Tags.BAGGAGE_FIELD.tag(bar, initialSpan);
+
Tags.BAGGAGE_FIELD.tag(BUSINESS_PROCESS, initialSpan);
diff --git a/reference/html/spring-cloud-sleuth.html b/reference/html/spring-cloud-sleuth.html
index 76e7380a2..99fef69c1 100644
--- a/reference/html/spring-cloud-sleuth.html
+++ b/reference/html/spring-cloud-sleuth.html
@@ -135,7 +135,11 @@ $(globalSwitch);
5. Sampling
-
6. Baggage
+
6. Baggage
+
+
7. Instrumentation
8. Span lifecycle