From 8f69ce2f6ba9f8031655792cd1e1b2bc7517a9ae Mon Sep 17 00:00:00 2001
From: buildmaster baggage- and, for messaging, it starts with baggage_.
![]() | Important |
|---|---|
There is currently no limitation of the count or size of baggage items. However, keep in mind that too many can decrease system throughput or increase RPC latency. In extreme cases, too much baggage can crash the application, due to exceeding transport-level message or header capacity. |
The following example shows setting baggage on a span:
Span initialSpan = this.tracer.nextSpan().name("span").start(); -try (Tracer.SpanInScope ws = this.tracer.withSpanInScope(initialSpan)) { - ExtraFieldPropagation.set("foo", "bar"); - ExtraFieldPropagation.set("UPPER_CASE", "someValue"); +ExtraFieldPropagation.set(initialSpan.context(), "foo", "bar"); +ExtraFieldPropagation.set(initialSpan.context(),"UPPER_CASE", "someValue"); }
Baggage travels with the trace (every child span contains the baggage of its parent). Zipkin has no knowledge of baggage and does not receive that information.
![]() | Important |
|---|---|
Starting from Sleuth 2.0.0 you have to pass the baggage key names explicitly in your project configuration. Read more about that setup here |
Tags are attached to a specific span. In other words, they are presented only for that particular span.
diff --git a/2.0.x/single/spring-cloud-sleuth.html b/2.0.x/single/spring-cloud-sleuth.html
index 569cf0b88..8a7ef79a8 100644
--- a/2.0.x/single/spring-cloud-sleuth.html
+++ b/2.0.x/single/spring-cloud-sleuth.html
@@ -136,9 +136,8 @@ Baggage travels together with the trace and is attached to every span.
Spring Cloud Sleuth understands that a header is baggage-related if the HTTP header is prefixed with baggage- and, for messaging, it starts with baggage_.
![]() | Important |
|---|---|
There is currently no limitation of the count or size of baggage items. However, keep in mind that too many can decrease system throughput or increase RPC latency. In extreme cases, too much baggage can crash the application, due to exceeding transport-level message or header capacity. |
The following example shows setting baggage on a span:
Span initialSpan = this.tracer.nextSpan().name("span").start(); -try (Tracer.SpanInScope ws = this.tracer.withSpanInScope(initialSpan)) { - ExtraFieldPropagation.set("foo", "bar"); - ExtraFieldPropagation.set("UPPER_CASE", "someValue"); +ExtraFieldPropagation.set(initialSpan.context(), "foo", "bar"); +ExtraFieldPropagation.set(initialSpan.context(),"UPPER_CASE", "someValue"); }
Baggage travels with the trace (every child span contains the baggage of its parent). Zipkin has no knowledge of baggage and does not receive that information.
![]() | Important |
|---|---|
Starting from Sleuth 2.0.0 you have to pass the baggage key names explicitly in your project configuration. Read more about that setup here |
Tags are attached to a specific span. In other words, they are presented only for that particular span.
diff --git a/2.0.x/spring-cloud-sleuth.xml b/2.0.x/spring-cloud-sleuth.xml
index 4aae5cfad..0b6985276 100644
--- a/2.0.x/spring-cloud-sleuth.xml
+++ b/2.0.x/spring-cloud-sleuth.xml
@@ -364,9 +364,8 @@ In extreme cases, too much baggage can crash the application, due to exceeding t