Sync docs from master to gh-pages
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]-->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="generator" content="Asciidoctor 1.5.7.1">
|
||||
<title>Untitled</title>
|
||||
<title>Adding Sleuth to Your Classpath:</title>
|
||||
<link rel="stylesheet" href="css/spring.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
|
||||
@@ -90,18 +90,35 @@ $(addBlockSwitches);
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body class="book">
|
||||
<body class="book toc2 toc-left">
|
||||
<div id="header">
|
||||
<div id="toc" class="toc2">
|
||||
<div id="toctitle">Table of Contents</div>
|
||||
<ul class="sectlevel1">
|
||||
<li><a href="#_adding_sleuth_to_your_classpath">Adding Sleuth to Your Classpath:</a>
|
||||
<ul class="sectlevel2">
|
||||
<li><a href="#_maven">Maven</a></li>
|
||||
<li><a href="#_gradle">Gradle</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="content">
|
||||
<div id="preamble">
|
||||
<div class="sect1">
|
||||
<h2 id="_adding_sleuth_to_your_classpath"><a class="link" href="#_adding_sleuth_to_your_classpath">Adding Sleuth to Your Classpath:</a></h2>
|
||||
<div class="sectionbody">
|
||||
<div class="paragraph">
|
||||
<p>Add Sleuth to your classpath:</p>
|
||||
<p>This section details how to add Sleuth to your class path for both Maven and Gradle</p>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_maven"><a class="link" href="#_maven">Maven</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>Maven</p>
|
||||
<p>To add Sleuth to your classpath with Maven, add the following elements
|
||||
to your <code>pom.xml</code> file:</p>
|
||||
</div>
|
||||
<div class="exampleblock">
|
||||
<div class="content">
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre class="highlightjs highlight"><code class="language-xml hljs" data-lang="xml"><dependencyManagement>
|
||||
@@ -123,12 +140,20 @@ $(addBlockSwitches);
|
||||
</dependencies></code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Gradle</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_gradle"><a class="link" href="#_gradle">Gradle</a></h3>
|
||||
<div class="paragraph">
|
||||
<p>To add Sleuth to your classpath with Gradle, add the following
|
||||
to your <code>build.gradle</code> file:</p>
|
||||
</div>
|
||||
<div class="exampleblock">
|
||||
<div class="content">
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre class="highlightjs highlight"><code class="language-groovy hljs" data-lang="groovy">buildscript {
|
||||
<pre>buildscript {
|
||||
dependencies {
|
||||
classpath "io.spring.gradle:dependency-management-plugin:0.5.2.RELEASE"
|
||||
}
|
||||
@@ -143,15 +168,20 @@ dependencyManagement {
|
||||
}
|
||||
dependencies {
|
||||
compile 'org.springframework.cloud:spring-cloud-starter-sleuth'
|
||||
}</code></pre>
|
||||
}</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>As long as Spring Cloud Sleuth is on the classpath any Spring Boot application will generate trace data:</p>
|
||||
<p>As long as Spring Cloud Sleuth is on the classpath, any Spring Boot application can
|
||||
generate trace data. The following example shows how to do so:</p>
|
||||
</div>
|
||||
<div class="exampleblock">
|
||||
<div class="content">
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">@SpringBootApplication
|
||||
<pre>@SpringBootApplication
|
||||
@RestController
|
||||
public class Application {
|
||||
|
||||
@@ -167,11 +197,16 @@ public class Application {
|
||||
SpringApplication.run(Application.class, args);
|
||||
}
|
||||
|
||||
}</code></pre>
|
||||
}</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Run this app and then hit the home page. You will see traceId and spanId populated in the logs. If this app calls out to another one (e.g. with <code>RestTemplate</code>) it will send the trace data in headers and if the receiver is another Sleuth app you will see the trace continue there.</p>
|
||||
<p>Now you can run this application and visit the home page. In the logs, you can see
|
||||
<code>traceId</code> and <code>spanId</code> populated. If this application calls out to another one (for
|
||||
example, with <code>RestTemplate</code>), it sends the trace data in headers, and, if the receiver is
|
||||
another Sleuth application, you can see the trace continue there.</p>
|
||||
</div>
|
||||
<div class="admonitionblock important">
|
||||
<table>
|
||||
@@ -180,7 +215,8 @@ public class Application {
|
||||
<i class="fa icon-important" title="Important"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
instead of logging the request in the handler explicitly, you could set <code>logging.level.org.springframework.web.servlet.DispatcherServlet=DEBUG</code>
|
||||
instead of logging the request in the handler explicitly, you could set
|
||||
<code>logging.level.org.springframework.web.servlet.DispatcherServlet=DEBUG</code>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -192,7 +228,10 @@ instead of logging the request in the handler explicitly, you could set <code>lo
|
||||
<i class="fa icon-important" title="Important"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
If you use Zipkin, configure the probability of spans exported by setting (for <code>2.0.x</code>) <code>spring.sleuth.sampler.probability</code> or (up till <code>2.0.x</code>)<code>spring.sleuth.sampler.percentage</code> (default: 0.1, which is 10 percent). Otherwise, you might think that Sleuth is not working because it omits some spans.
|
||||
If you use Zipkin, you can configure the probability of spans being exported by
|
||||
setting (for <code>2.0.x</code>) <code>spring.sleuth.sampler.probability</code> or (up till <code>2.0.x</code>)
|
||||
<code>spring.sleuth.sampler.percentage</code> (default: 0.1, which is 10 percent). Otherwise, you
|
||||
might think that Sleuth is not working because it omits some spans.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -204,7 +243,8 @@ If you use Zipkin, configure the probability of spans exported by setting (for <
|
||||
<i class="fa icon-important" title="Important"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
Set <code>spring.application.name=bar</code> (for instance) to see the service name as well as the trace and span ids.
|
||||
Set <code>spring.application.name=bar</code> (for instance) to see the service name as
|
||||
well as the trace and span IDs.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -212,6 +252,7 @@ Set <code>spring.application.name=bar</code> (for instance) to see the service n
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="js/tocbot/tocbot.min.js"></script>
|
||||
<script type="text/javascript" src="js/toc.js"></script>
|
||||
<link rel="stylesheet" href="js/highlight/styles/atom-one-dark-reasonable.min.css">
|
||||
|
||||
Reference in New Issue
Block a user