diff --git a/1.2.x/multi/multi__introduction.html b/1.2.x/multi/multi__introduction.html index dd9978448..cba0d65df 100644 --- a/1.2.x/multi/multi__introduction.html +++ b/1.2.x/multi/multi__introduction.html @@ -128,9 +128,10 @@ Baggage is an optional part.
Baggage is a set of key:value pairs stored in
and is attached to every span. Spring Cloud Sleuth will understand that a header is baggage related if the HTTP
header is prefixed with baggage- and for messaging it starts with baggage_.
![]() | Important |
|---|---|
There’s 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, it could crash the app due -to exceeding transport-level message or header capacity. |
Example of setting baggage on a span:
Span initialSpan = this.tracer.createSpan("span"); -initialSpan.setBaggageItem("foo", "bar"); -initialSpan.setBaggageItem("UPPER_CASE", "someValue");
Baggage travels with the trace (i.e. every child span contains the baggage of its parent). Zipkin has no knowledge of +to exceeding transport-level message or header capacity.
Example of 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");
Baggage travels with the trace (i.e. every child span contains the baggage of its parent). Zipkin has no knowledge of baggage and will not even receive that information.
Tags are attached to a specific span - they are presented for that particular span only. However you can search by tag to find the trace, where there exists a span having the searched tag value.
If you want to be able to lookup a span based on baggage, you should add corresponding entry as a tag in the root span.
@Autowired Tracer tracer; diff --git a/1.2.x/single/spring-cloud-sleuth.html b/1.2.x/single/spring-cloud-sleuth.html index 29eb70000..32fc526aa 100644 --- a/1.2.x/single/spring-cloud-sleuth.html +++ b/1.2.x/single/spring-cloud-sleuth.html @@ -128,9 +128,10 @@ Baggage is an optional part.Baggage is a set of key:value pairs stored in and is attached to every span. Spring Cloud Sleuth will understand that a header is baggage related if the HTTP header is prefixed with
baggage-and for messaging it starts withbaggage_.
Important There’s 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, it could crash the app due -to exceeding transport-level message or header capacity.
Example of setting baggage on a span:
Span initialSpan = this.tracer.createSpan("span"); -initialSpan.setBaggageItem("foo", "bar"); -initialSpan.setBaggageItem("UPPER_CASE", "someValue");Baggage travels with the trace (i.e. every child span contains the baggage of its parent). Zipkin has no knowledge of +to exceeding transport-level message or header capacity.
Example of 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");Baggage travels with the trace (i.e. every child span contains the baggage of its parent). Zipkin has no knowledge of baggage and will not even receive that information.
Tags are attached to a specific span - they are presented for that particular span only. However you can search by tag to find the trace, where there exists a span having the searched tag value.
If you want to be able to lookup a span based on baggage, you should add corresponding entry as a tag in the root span.
@Autowired Tracer tracer; diff --git a/1.2.x/spring-cloud-sleuth.xml b/1.2.x/spring-cloud-sleuth.xml index 546d12f5c..51743b53f 100644 --- a/1.2.x/spring-cloud-sleuth.xml +++ b/1.2.x/spring-cloud-sleuth.xml @@ -348,9 +348,10 @@ too many can decrease system throughput or increase RPC latency. In extreme case to exceeding transport-level message or header capacity.Example of setting baggage on a span: -Span initialSpan = this.tracer.createSpan("span"); -initialSpan.setBaggageItem("foo", "bar"); -initialSpan.setBaggageItem("UPPER_CASE", "someValue"); +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"); Baggage vs. Span Tags Baggage travels with the trace (i.e. every child span contains the baggage of its parent). Zipkin has no knowledge of