Migrated to docs.spring.io

This commit is contained in:
Marcin Grzejszczak
2020-06-04 13:21:13 +02:00
parent bcb16d5341
commit b31c0fe18f
5 changed files with 153 additions and 127 deletions

View File

@@ -12,11 +12,11 @@
|spring.sleuth.feign.processor.enabled | true | Enable post processor that wraps Feign Context in its tracing representations.
|spring.sleuth.grpc.enabled | true | Enable span information propagation when using GRPC.
|spring.sleuth.http.enabled | true |
|spring.sleuth.http.legacy.enabled | false | Enables the legacy Sleuth setup.
|spring.sleuth.http.legacy.enabled | false |
|spring.sleuth.hystrix.strategy.enabled | true | Enable custom HystrixConcurrencyStrategy that wraps all Callable instances into their Sleuth representative - the TraceCallable.
|spring.sleuth.hystrix.strategy.passthrough | false | When enabled the tracing information is passed to the Hystrix execution threads but spans are not created for each execution.
|spring.sleuth.integration.enabled | true | Enable Spring Integration sleuth instrumentation.
|spring.sleuth.integration.patterns | [!hystrixStreamOutput*, *] | An array of patterns against which channel names will be matched. @see org.springframework.integration.config.GlobalChannelInterceptor#patterns() Defaults to any channel name not matching the Hystrix Stream channel name.
|spring.sleuth.integration.patterns | [!hystrixStreamOutput*, *, !channel*] | An array of patterns against which channel names will be matched. @see org.springframework.integration.config.GlobalChannelInterceptor#patterns() Defaults to any channel name not matching the Hystrix Stream and functional Stream channel names.
|spring.sleuth.integration.websockets.enabled | true | Enable tracing for WebSockets.
|spring.sleuth.keys.http.headers | | Additional headers that should be added as tags if they exist. If the header value is multi-valued, the tag value will be a comma-separated, single-quoted list.
|spring.sleuth.keys.http.prefix | http. | Prefix for header names if they are added as tags.
@@ -33,12 +33,13 @@
|spring.sleuth.messaging.rabbit.remote-service-name | rabbitmq |
|spring.sleuth.opentracing.enabled | true |
|spring.sleuth.propagation-keys | | List of fields that are referenced the same in-process as it is on the wire. For example, the name "x-vcap-request-id" would be set as-is including the prefix. <p> Note: {@code fieldName} will be implicitly lower-cased. @see brave.propagation.ExtraFieldPropagation.FactoryBuilder#addField(String)
|spring.sleuth.propagation.tag.enabled | true | Enables a {@link TagPropagationSpanHandler} that adds extra propagated fields to span tags.
|spring.sleuth.propagation.tag.enabled | true | Enables a {@link TagPropagationFinishedSpanHandler} that adds extra propagated fields to span tags.
|spring.sleuth.propagation.tag.whitelisted-keys | | A list of keys to be put from extra propagation fields to span tags.
|spring.sleuth.reactor.decorate-on-each | true | When true decorates on each operator, will be less performing, but logging will always contain the tracing entries in each operator. When false decorates on last operator, will be more performing, but logging might not always contain the tracing entries.
|spring.sleuth.reactor.enabled | true | When true enables instrumentation for reactor.
|spring.sleuth.redis.enabled | true | Enable span information propagation when using Redis.
|spring.sleuth.redis.remote-service-name | redis | Service name for the remote Redis endpoint.
|spring.sleuth.rpc.enabled | true | Enable tracing of RPC.
|spring.sleuth.rxjava.schedulers.hook.enabled | true | Enable support for RxJava via RxJavaSchedulersHook.
|spring.sleuth.rxjava.schedulers.ignoredthreads | [HystrixMetricPoller, ^RxComputation.*$] | Thread names for which spans will not be sampled.
|spring.sleuth.sampler.probability | | Probability of requests that should be sampled. E.g. 1.0 - 100% requests should be sampled. The precision is whole-numbers only (i.e. there's no support for 0.1% of the traces).
@@ -72,4 +73,4 @@
|spring.zipkin.sender.type | | Means of sending spans to Zipkin.
|spring.zipkin.service.name | | The name of the service, from which the Span was sent via HTTP, that should appear in Zipkin.
|===
|===

View File

@@ -45,9 +45,11 @@ Each color of a note signifies a span (there are seven spans - from *A* to *G*).
Consider the following note:
[source]
----
Trace Id = X
Span Id = D
Client Sent
----
This note indicates that the current span has *Trace Id* set to *X* and *Span Id* set to *D*.
Also, the `Client Sent` event took place.
@@ -141,6 +143,7 @@ https://docssleuth-zipkin-server.cfapps.io/dependency[Click here to see it live!
When using grep to read the logs of those four applications by scanning for a trace ID equal to (for example) `2485ec27856c56f4`, you get output resembling the following:
[source]
----
service1.log:2016-02-26 11:15:47.561 INFO [service1,2485ec27856c56f4,2485ec27856c56f4,true] 68058 --- [nio-8081-exec-1] i.s.c.sleuth.docs.service1.Application : Hello from service1. Calling service2
service2.log:2016-02-26 11:15:47.710 INFO [service2,2485ec27856c56f4,9aa10ee6fbde75fa,true] 68059 --- [nio-8082-exec-1] i.s.c.sleuth.docs.service2.Application : Hello from service2. Calling service3 and then service4
service3.log:2016-02-26 11:15:47.895 INFO [service3,2485ec27856c56f4,1210be13194bfe5,true] 68060 --- [nio-8083-exec-1] i.s.c.sleuth.docs.service3.Application : Hello from service3
@@ -148,6 +151,7 @@ service2.log:2016-02-26 11:15:47.924 INFO [service2,2485ec27856c56f4,9aa10ee6fb
service4.log:2016-02-26 11:15:48.134 INFO [service4,2485ec27856c56f4,1b1845262ffba49d,true] 68061 --- [nio-8084-exec-1] i.s.c.sleuth.docs.service4.Application : Hello from service4
service2.log:2016-02-26 11:15:48.156 INFO [service2,2485ec27856c56f4,9aa10ee6fbde75fa,true] 68059 --- [nio-8082-exec-1] i.s.c.sleuth.docs.service2.Application : Got response from service4 [Hello from service4]
service1.log:2016-02-26 11:15:48.182 INFO [service1,2485ec27856c56f4,2485ec27856c56f4,true] 68058 --- [nio-8081-exec-1] i.s.c.sleuth.docs.service1.Application : Got response from service2 [Hello from service2, response from service3 [Hello from service3] and from service4 [Hello from service4]]
----
If you use a log aggregating tool (such as https://www.elastic.co/products/kibana[Kibana], https://www.splunk.com/[Splunk], and others), you can order the events that took place.
An example from Kibana would resemble the following image:
@@ -157,6 +161,7 @@ image::https://raw.githubusercontent.com/spring-cloud/spring-cloud-sleuth/{branc
If you want to use https://www.elastic.co/guide/en/logstash/current/index.html[Logstash], the following listing shows the Grok pattern for Logstash:
[source]
----
filter {
# pattern matching logback pattern
grok {
@@ -169,9 +174,11 @@ filter {
remove_field => ["timestamp"]
}
}
----
NOTE: If you want to use Grok together with the logs from Cloud Foundry, you have to use the following pattern:
[source]
----
filter {
# pattern matching logback pattern
grok {
@@ -184,6 +191,7 @@ filter {
remove_field => ["timestamp"]
}
}
----
===== JSON Logback with Logstash
@@ -200,9 +208,9 @@ To do so, you have to do the following (for readability, we pass the dependencie
Consider the following example of a Logback configuration file (named https://github.com/spring-cloud-samples/sleuth-documentation-apps/blob/master/service1/src/main/resources/logback-spring.xml[logback-spring.xml]).
[source,xml]
-----
----
include::https://raw.githubusercontent.com/spring-cloud-samples/sleuth-documentation-apps/master/service1/src/main/resources/logback-spring.xml[]
-----
----
That Logback configuration file:
@@ -276,8 +284,8 @@ If you want to use only Spring Cloud Sleuth without the Zipkin integration, add
The following example shows how to add Sleuth with Maven:
[source,xml,indent=0,subs="verbatim,attributes",role="primary"]
.Maven
[source,xml,indent=0,subs="verbatim,attributes",role="primary"]
----
<dependencyManagement> <1>
<dependencies>
@@ -301,8 +309,8 @@ The following example shows how to add Sleuth with Maven:
The following example shows how to add Sleuth with Gradle:
[source,groovy,indent=0,subs="verbatim,attributes",role="secondary"]
.Gradle
[source,groovy,indent=0,subs="verbatim,attributes",role="secondary"]
----
dependencyManagement { <1>
imports {
@@ -323,8 +331,8 @@ If you want both Sleuth and Zipkin, add the `spring-cloud-starter-zipkin` depend
The following example shows how to do so for Maven:
[source,xml,indent=0,subs="verbatim,attributes",role="primary"]
.Maven
[source,xml,indent=0,subs="verbatim,attributes",role="primary"]
----
<dependencyManagement> <1>
<dependencies>
@@ -348,8 +356,8 @@ The following example shows how to do so for Maven:
The following example shows how to do so for Gradle:
[source,groovy,indent=0,subs="verbatim,attributes",role="secondary"]
.Gradle
[source,groovy,indent=0,subs="verbatim,attributes",role="secondary"]
----
dependencyManagement { <1>
imports {
@@ -383,8 +391,8 @@ dependencies.
The following example shows how to do so for Gradle:
[source,xml,indent=0,subs="verbatim,attributes",role="primary"]
.Maven
[source,xml,indent=0,subs="verbatim,attributes",role="primary"]
----
<dependencyManagement> <1>
<dependencies>
@@ -411,8 +419,8 @@ The following example shows how to do so for Gradle:
<2> Add the dependency to `spring-cloud-starter-zipkin`. That way, all nested dependencies get downloaded.
<3> To automatically configure RabbitMQ, add the `spring-rabbit` dependency.
[source,groovy,indent=0,subs="verbatim,attributes",role="secondary"]
.Gradle
[source,groovy,indent=0,subs="verbatim,attributes",role="secondary"]
----
dependencyManagement { <1>
imports {