Sync docs from master to gh-pages

This commit is contained in:
Marcin Grzejszczak
2017-02-08 13:29:30 +01:00
parent 010ce1d269
commit 47975d6850

View File

@@ -438,6 +438,11 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
<li><a href="#_json_logback_with_logstash">JSON Logback with Logstash</a></li>
</ul>
</li>
<li><a href="#_propagating_span_context">Propagating Span Context</a>
<ul class="sectlevel4">
<li><a href="#_baggage_vs_span_tags">Baggage vs. Span Tags</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#_adding_to_the_project">Adding to the project</a>
@@ -935,6 +940,67 @@ If you&#8217;re using a custom <code>logback-spring.xml</code> then you have to
</div>
</div>
</div>
<div class="sect3">
<h4 id="_propagating_span_context">Propagating Span Context</h4>
<div class="paragraph">
<p>The span context is the state that must get propagated to any child Spans across process boundaries.
Part of the Span Context is the Baggage. The trace and span IDs are a required part of the span context.
Baggage is an optional part.</p>
</div>
<div class="paragraph">
<p>Baggage is a set of key:value pairs stored in the span context. Baggage travels together with the trace
and is attached to every span. Spring Cloud Sleuth will understand that a header is baggage related if the HTTP
header is prefixed with <code>baggage-</code> and for messaging it starts with <code>baggage_</code>.</p>
</div>
<div class="admonitionblock important">
<table>
<tr>
<td class="icon">
<div class="title">Important</div>
</td>
<td class="content">
There&#8217;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.
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>Example of setting baggage on a span:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-java" data-lang="java">Span initialSpan = this.tracer.createSpan("span");
initialSpan.setBaggageItem("foo", "bar");</code></pre>
</div>
</div>
<div class="sect4">
<h5 id="_baggage_vs_span_tags">Baggage vs. Span Tags</h5>
<div class="paragraph">
<p>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.</p>
</div>
<div class="paragraph">
<p>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.</p>
</div>
<div class="paragraph">
<p>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.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-java" data-lang="java">@Autowired Tracer tracer;
Span span = tracer.getCurrentSpan();
String baggageKey = "key";
String baggageValue = "foo";
span.setBaggageItem(baggageKey, baggageValue);
tracer.addTag(baggageKey, baggageValue);</code></pre>
</div>
</div>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_adding_to_the_project">Adding to the project</h3>
@@ -952,7 +1018,7 @@ the <code>spring-cloud-starter-sleuth</code> module to your project.</p>
&lt;dependency&gt;
&lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
&lt;artifactId&gt;spring-cloud-dependencies&lt;/artifactId&gt;
&lt;version&gt;Brixton.RELEASE&lt;/version&gt;
&lt;version&gt;Camden.RELEASE&lt;/version&gt;
&lt;type&gt;pom&lt;/type&gt;
&lt;scope&gt;import&lt;/scope&gt;
&lt;/dependency&gt;
@@ -981,7 +1047,7 @@ the Spring BOM</p>
<div class="content">
<pre class="highlight"><code class="language-groovy" data-lang="groovy">dependencyManagement { <b class="conum">(1)</b>
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:Brixton.RELEASE"
mavenBom "org.springframework.cloud:spring-cloud-dependencies:Camden.RELEASE"
}
}
@@ -1015,7 +1081,7 @@ the Spring BOM</p>
&lt;dependency&gt;
&lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
&lt;artifactId&gt;spring-cloud-dependencies&lt;/artifactId&gt;
&lt;version&gt;Brixton.RELEASE&lt;/version&gt;
&lt;version&gt;Camden.RELEASE&lt;/version&gt;
&lt;type&gt;pom&lt;/type&gt;
&lt;scope&gt;import&lt;/scope&gt;
&lt;/dependency&gt;
@@ -1044,7 +1110,7 @@ the Spring BOM</p>
<div class="content">
<pre class="highlight"><code class="language-groovy" data-lang="groovy">dependencyManagement { <b class="conum">(1)</b>
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:Brixton.RELEASE"
mavenBom "org.springframework.cloud:spring-cloud-dependencies:Camden.RELEASE"
}
}
@@ -1078,7 +1144,7 @@ the Spring BOM</p>
&lt;dependency&gt;
&lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
&lt;artifactId&gt;spring-cloud-dependencies&lt;/artifactId&gt;
&lt;version&gt;Brixton.RELEASE&lt;/version&gt;
&lt;version&gt;Camden.RELEASE&lt;/version&gt;
&lt;type&gt;pom&lt;/type&gt;
&lt;scope&gt;import&lt;/scope&gt;
&lt;/dependency&gt;
@@ -1122,7 +1188,7 @@ the Spring BOM</p>
<div class="content">
<pre class="highlight"><code class="language-groovy" data-lang="groovy">dependencyManagement { <b class="conum">(1)</b>
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:Brixton.RELEASE"
mavenBom "org.springframework.cloud:spring-cloud-dependencies:Camden.RELEASE"
}
}
@@ -1166,7 +1232,7 @@ dependency</p>
&lt;dependency&gt;
&lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
&lt;artifactId&gt;spring-cloud-dependencies&lt;/artifactId&gt;
&lt;version&gt;Brixton.RELEASE&lt;/version&gt;
&lt;version&gt;Camden.RELEASE&lt;/version&gt;
&lt;type&gt;pom&lt;/type&gt;
&lt;scope&gt;import&lt;/scope&gt;
&lt;/dependency&gt;
@@ -1210,7 +1276,7 @@ the Spring BOM</p>
<div class="content">
<pre class="highlight"><code class="language-groovy" data-lang="groovy">dependencyManagement { <b class="conum">(1)</b>
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:Brixton.RELEASE"
mavenBom "org.springframework.cloud:spring-cloud-dependencies:Camden.RELEASE"
}
}