Sync docs from 1.1.x to gh-pages

This commit is contained in:
buildmaster
2017-04-19 08:37:48 +00:00
parent 5458d18351
commit 2e55809016

View File

@@ -472,6 +472,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
<li><a href="#_example">Example</a></li>
<li><a href="#_custom_sa_tag_in_zipkin">Custom SA tag in Zipkin</a></li>
<li><a href="#_custom_service_name">Custom service name</a></li>
<li><a href="#_customization_of_reported_spans">Customization of reported spans</a></li>
<li><a href="#_host_locator">Host locator</a></li>
</ul>
</li>
@@ -2017,6 +2018,31 @@ Remember not to add both <code>peer.service</code> tag and the <code>SA</code> t
</div>
</div>
<div class="sect2">
<h3 id="_customization_of_reported_spans">Customization of reported spans</h3>
<div class="paragraph">
<p>Before reporting spans to e.g. Zipkin you can be interested in modifying that span in some way.
You can achieve that by using the <code>SpanAdjuster</code> interface.</p>
</div>
<div class="paragraph">
<p>Example of usage:</p>
</div>
<div class="paragraph">
<p>In Sleuth we&#8217;re generating spans with a fixed name. Some users want to modify the name depending on values
of tags. Implementation of the <code>SpanAdjuster</code> interface can be used to alter that name. Example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-yaml" data-lang="yaml">@Bean
SpanAdjuster customSpanAdjuster() {
return span -&gt; span.toBuilder().name(scrub(span.getName())).build();
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>This will lead in changing the name of the reported span just before it gets sent to Zipkin.</p>
</div>
</div>
<div class="sect2">
<h3 id="_host_locator">Host locator</h3>
<div class="paragraph">
<p>In order to define the host that is corresponding to a particular span we need to resolve the host name