Starting with Sleuth 2.0.0 we no longer register
@@ -107,7 +111,9 @@ however will be still there. spring.sleuth.async.enabled to false. If you annotate your method with @Async then we’ll automatically create a new Span with the following characteristics: - if the method is annotated with
@SpanName then the value of the annotation will be the Span’s name - if the method is not annotated with
@SpanName the Span name will be the annotated method name - the Span will be tagged with that method’s class name and the method name too
15.8.2 @Scheduled annotated methodsIn Spring Cloud Sleuth we’re instrumenting scheduled method execution so that the tracing information is passed between threads. You can disable this behaviour
by setting the value of spring.sleuth.scheduled.enabled to false. If you annotate your method with @Scheduled then we’ll automatically create a new Span with the following characteristics: - the Span name will be the annotated method name
- the Span will be tagged with that method’s class name and the method name too
If you want to skip Span creation for some @Scheduled annotated classes you can set the
spring.sleuth.scheduled.skipPattern with a regular expression that will match the fully qualified name of the
-@Scheduled annotated class. ![[Tip]](images/tip.png) | Tip |
|---|
If you are using spring-cloud-sleuth-stream and spring-cloud-netflix-hystrix-stream together, Span will be created for each Hystrix metrics and sent to Zipkin. This may be annoying. You can prevent this by setting spring.sleuth.scheduled.skipPattern=org.springframework.cloud.netflix.hystrix.stream.HystrixStreamTask |
15.8.3 Executor, ExecutorService and ScheduledExecutorServiceWe’re providing LazyTraceExecutor, TraceableExecutorService and TraceableScheduledExecutorService. Those implementations
+@Scheduled annotated class. ![[Tip]](images/tip.png) | Tip |
|---|
If you are using spring-cloud-sleuth-stream and spring-cloud-netflix-hystrix-stream together, Span will be created for
+each Hystrix metrics and sent to Zipkin. This may be annoying. You can prevent this by setting
+spring.sleuth.scheduled.skipPattern=org.springframework.cloud.netflix.hystrix.stream.HystrixStreamTask |
15.8.3 Executor, ExecutorService and ScheduledExecutorServiceWe’re providing LazyTraceExecutor, TraceableExecutorService and TraceableScheduledExecutorService. Those implementations
are creating Spans each time a new task is submitted, invoked or scheduled. Here you can see an example of how to pass tracing information with TraceableExecutorService when working with CompletableFuture: CompletableFuture<Long> completableFuture = CompletableFuture.supplyAsync(() -> {
return 1_000_000L;
diff --git a/single/spring-cloud-sleuth.html b/single/spring-cloud-sleuth.html
index 15c090da5..b010dffe9 100644
--- a/single/spring-cloud-sleuth.html
+++ b/single/spring-cloud-sleuth.html
@@ -778,7 +778,9 @@ on before the Action was scheduled. To disable the custom RxJavaSchedulersHook s
of regular expressions in the spring.sleuth.rxjava.schedulers.ignoredthreads property.Features from this section can be disabled by providing the spring.sleuth.web.enabled property with value equal to false. Via the TraceFilter all sampled incoming requests result in creation of a Span. That Span’s name is http: + the path to which
the request was sent. E.g. if the request was sent to /foo/bar then the name will be http:/foo/bar. You can configure which URIs you would
like to skip via the spring.sleuth.web.skipPattern property. If you have ManagementServerProperties on classpath then
- its value of contextPath gets appended to the provided skip pattern. 15.5.2 HandlerInterceptorSince we want the span names to be precise we’re using a TraceHandlerInterceptor that either wraps an
+ its value of contextPath gets appended to the provided skip pattern. If you want to reuse the
+ Sleuth’s default skip patterns and just append your own, pass those patterns via
+ the spring.sleuth.web.additionalSkipPattern. 15.5.2 HandlerInterceptorSince we want the span names to be precise we’re using a TraceHandlerInterceptor that either wraps an
existing HandlerInterceptor or is added directly to the list of existing HandlerInterceptors. The
TraceHandlerInterceptor adds a special request attribute to the given HttpServletRequest. If the
the TraceFilter doesn’t see this attribute set it will create a "fallback" span which is an additional
@@ -786,7 +788,9 @@ of regular expressions in the spring.sleuth.rxjava.schedul
signifies that there is a missing instrumentation. In that case please file an issue in Spring Cloud Sleuth. 15.5.3 Async Servlet supportIf your controller returns a Callable or a WebAsyncTask Spring Cloud Sleuth will continue the existing span instead of creating a new one. Via the TraceWebFilter all sampled incoming requests result in creation of a Span. That Span’s name is http: + the path to which
the request was sent. E.g. if the request was sent to /foo/bar then the name will be http:/foo/bar. You can configure which URIs you would
like to skip via the spring.sleuth.web.skipPattern property. If you have ManagementServerProperties on classpath then
- its value of contextPath gets appended to the provided skip pattern. 15.6 HTTP client integration15.6.1 Synchronous Rest TemplateWe’re injecting a RestTemplate interceptor that ensures that all the tracing information is passed to the requests. Each time a
+ its value of contextPath gets appended to the provided skip pattern. If you want to reuse the
+ Sleuth’s default skip patterns and just append your own, pass those patterns via
+ the spring.sleuth.web.additionalSkipPattern. 15.6 HTTP client integration15.6.1 Synchronous Rest TemplateWe’re injecting a RestTemplate interceptor that ensures that all the tracing information is passed to the requests. Each time a
call is made a new Span is created. It gets closed upon receiving the response. In order to block the synchronous RestTemplate features
just set spring.sleuth.web.client.enabled to false. ![[Important]](images/important.png) | Important |
|---|
You have to register RestTemplate as a bean so that the interceptors will get injected.
If you create a RestTemplate instance with a new keyword then the instrumentation WILL NOT work. |
15.6.2 Asynchronous Rest Template![[Important]](images/important.png) | Important |
|---|
Starting with Sleuth 2.0.0 we no longer register
@@ -830,7 +834,9 @@ however will be still there. spring.sleuth.async.enabled to false. If you annotate your method with @Async then we’ll automatically create a new Span with the following characteristics: - if the method is annotated with
@SpanName then the value of the annotation will be the Span’s name - if the method is not annotated with
@SpanName the Span name will be the annotated method name - the Span will be tagged with that method’s class name and the method name too
15.8.2 @Scheduled annotated methodsIn Spring Cloud Sleuth we’re instrumenting scheduled method execution so that the tracing information is passed between threads. You can disable this behaviour
by setting the value of spring.sleuth.scheduled.enabled to false. If you annotate your method with @Scheduled then we’ll automatically create a new Span with the following characteristics: - the Span name will be the annotated method name
- the Span will be tagged with that method’s class name and the method name too
If you want to skip Span creation for some @Scheduled annotated classes you can set the
spring.sleuth.scheduled.skipPattern with a regular expression that will match the fully qualified name of the
-@Scheduled annotated class. ![[Tip]](images/tip.png) | Tip |
|---|
If you are using spring-cloud-sleuth-stream and spring-cloud-netflix-hystrix-stream together, Span will be created for each Hystrix metrics and sent to Zipkin. This may be annoying. You can prevent this by setting spring.sleuth.scheduled.skipPattern=org.springframework.cloud.netflix.hystrix.stream.HystrixStreamTask |
15.8.3 Executor, ExecutorService and ScheduledExecutorServiceWe’re providing LazyTraceExecutor, TraceableExecutorService and TraceableScheduledExecutorService. Those implementations
+@Scheduled annotated class. ![[Tip]](images/tip.png) | Tip |
|---|
If you are using spring-cloud-sleuth-stream and spring-cloud-netflix-hystrix-stream together, Span will be created for
+each Hystrix metrics and sent to Zipkin. This may be annoying. You can prevent this by setting
+spring.sleuth.scheduled.skipPattern=org.springframework.cloud.netflix.hystrix.stream.HystrixStreamTask |
15.8.3 Executor, ExecutorService and ScheduledExecutorServiceWe’re providing LazyTraceExecutor, TraceableExecutorService and TraceableScheduledExecutorService. Those implementations
are creating Spans each time a new task is submitted, invoked or scheduled. Here you can see an example of how to pass tracing information with TraceableExecutorService when working with CompletableFuture: CompletableFuture<Long> completableFuture = CompletableFuture.supplyAsync(() -> {
return 1_000_000L;
diff --git a/spring-cloud-sleuth.xml b/spring-cloud-sleuth.xml
index cc8572709..c30f8ac41 100644
--- a/spring-cloud-sleuth.xml
+++ b/spring-cloud-sleuth.xml
@@ -1654,7 +1654,9 @@ of regular expressions in the spring.sleuth.rxjava.schedulers.ignoredth
Via the TraceFilter all sampled incoming requests result in creation of a Span. That Span’s name is http: + the path to which
the request was sent. E.g. if the request was sent to /foo/bar then the name will be http:/foo/bar. You can configure which URIs you would
like to skip via the spring.sleuth.web.skipPattern property. If you have ManagementServerProperties on classpath then
- its value of contextPath gets appended to the provided skip pattern.
+ its value of contextPath gets appended to the provided skip pattern. If you want to reuse the
+ Sleuth’s default skip patterns and just append your own, pass those patterns via
+ the spring.sleuth.web.additionalSkipPattern.
HandlerInterceptor
@@ -1674,7 +1676,9 @@ of regular expressions in the spring.sleuth.rxjava.schedulers.ignoredth
Via the TraceWebFilter all sampled incoming requests result in creation of a Span. That Span’s name is http: + the path to which
the request was sent. E.g. if the request was sent to /foo/bar then the name will be http:/foo/bar. You can configure which URIs you would
like to skip via the spring.sleuth.web.skipPattern property. If you have ManagementServerProperties on classpath then
- its value of contextPath gets appended to the provided skip pattern.
+ its value of contextPath gets appended to the provided skip pattern. If you want to reuse the
+ Sleuth’s default skip patterns and just append your own, pass those patterns via
+ the spring.sleuth.web.additionalSkipPattern.
@@ -1792,7 +1796,9 @@ by setting the value of spring.sleuth.scheduled.enabled to spring.sleuth.scheduled.skipPattern with a regular expression that will match the fully qualified name of the
@Scheduled annotated class.
-If you are using spring-cloud-sleuth-stream and spring-cloud-netflix-hystrix-stream together, Span will be created for each Hystrix metrics and sent to Zipkin. This may be annoying. You can prevent this by setting spring.sleuth.scheduled.skipPattern=org.springframework.cloud.netflix.hystrix.stream.HystrixStreamTask
+If you are using spring-cloud-sleuth-stream and spring-cloud-netflix-hystrix-stream together, Span will be created for
+each Hystrix metrics and sent to Zipkin. This may be annoying. You can prevent this by setting
+spring.sleuth.scheduled.skipPattern=org.springframework.cloud.netflix.hystrix.stream.HystrixStreamTask
|
|