From 682b7aee7c93ae87e56aec2ea38b3bee201a9ccb Mon Sep 17 00:00:00 2001
From: buildmaster spring.sleuth.feign
If you do so, no Feign-related instrumentation take place.
Part of Feign instrumentation is done through a FeignBeanPostProcessor.
You can disable it by setting spring.sleuth.feign.processor.enabled to false.
If you set it to false, Spring Cloud Sleuth does not instrument any of your custom Feign components.
-However, all the default instrumentation is still there.
In Spring Cloud Sleuth, we instrument async-related components so that the tracing information is passed between threads.
-You can disable this behavior by setting the value of spring.sleuth.async.enabled to false.
If you annotate your method with @Async, we automatically create a new Span with the following characteristics:
@SpanName, the value of the annotation is the Span’s name.@SpanName, the Span name is the annotated method name.In Spring Cloud Sleuth, we instrument scheduled method execution so that the tracing information is passed between threads. +However, all the default instrumentation is still there.
Spring Cloud Sleuth provides instrumentation for gRPC through TraceGrpcAutoConfiguration. You can disable it entirely by setting spring.sleuth.grpc.enabled to false.
![]() | Important |
|---|---|
The gRPC integration relies on two external libraries to instrument clients and servers and both of those libraries must be on the class path to enable the instrumentation. |
Maven:
<dependency> + <groupId>io.github.lognet</groupId> + <artifactId>grpc-spring-boot-starter</artifactId> + </dependency> + <dependency> + <groupId>io.zipkin.brave</groupId> + <artifactId>brave-instrumentation-grpc</artifactId> + </dependency>
Gradle:
compile("io.github.lognet:grpc-spring-boot-starter")
+ compile("io.zipkin.brave:brave-instrumentation-grpc")Spring Cloud Sleuth leverages grpc-spring-boot-starter to register Brave’s gRPC server interceptor with all services annotated with @GRpcService.
gRPC clients leverage a ManagedChannelBuilder to construct a ManagedChannel used to communicate to the gRPC server. The native ManagedChannelBuilder provides static methods as entry points for construction of ManagedChannel instances, however, this mechanism is outside the influence of the Spring application context.
![]() | Important |
|---|---|
Spring Cloud Sleuth provides a |
Sleuth creates a TracingManagedChannelBuilderCustomizer which inject Brave’s client interceptor into the SpringAwareManagedChannelBuilder.
In Spring Cloud Sleuth, we instrument async-related components so that the tracing information is passed between threads.
+You can disable this behavior by setting the value of spring.sleuth.async.enabled to false.
If you annotate your method with @Async, we automatically create a new Span with the following characteristics:
@SpanName, the value of the annotation is the Span’s name.@SpanName, the Span name is the annotated method name.In Spring Cloud Sleuth, we instrument scheduled method execution so that the tracing information is passed between threads.
You can disable this behavior by setting the value of spring.sleuth.scheduled.enabled to false.
If you annotate your method with @Scheduled, we automatically create a new span with the following characteristics:
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 matches the fully qualified name of the @Scheduled annotated class.
If you use spring-cloud-sleuth-stream and spring-cloud-netflix-hystrix-stream together, a span is created for each Hystrix metrics and sent to Zipkin.
-This behavior may be annoying. That’s why, by default, spring.sleuth.scheduled.skipPattern=org.springframework.cloud.netflix.hystrix.stream.HystrixStreamTask.
We provide LazyTraceExecutor, TraceableExecutorService, and TraceableScheduledExecutorService. Those implementations create spans each time a new task is submitted, invoked, or scheduled.
The following example shows how to pass tracing information with TraceableExecutorService when working with CompletableFuture:
CompletableFuture<Long> completableFuture = CompletableFuture.supplyAsync(() -> {
+This behavior may be annoying. That’s why, by default, spring.sleuth.scheduled.skipPattern=org.springframework.cloud.netflix.hystrix.stream.HystrixStreamTask.We provide LazyTraceExecutor, TraceableExecutorService, and TraceableScheduledExecutorService. Those implementations create spans each time a new task is submitted, invoked, or scheduled.
The following example shows how to pass tracing information with TraceableExecutorService when working with CompletableFuture:
CompletableFuture<Long> completableFuture = CompletableFuture.supplyAsync(() -> {
// perform some logic
return 1_000_000L;
}, new TraceableExecutorService(beanFactory, executorService,
@@ -155,14 +163,14 @@ The following example shows how to set up such a custom Ex
return new LazyTraceExecutor(this.beanFactory, executor);
}
-}Features from this section can be disabled by setting the spring.sleuth.messaging.enabled property with value equal to false.
Spring Cloud Sleuth integrates with Spring Integration. +}
Features from this section can be disabled by setting the spring.sleuth.messaging.enabled property with value equal to false.
Spring Cloud Sleuth integrates with Spring Integration.
It creates spans for publish and subscribe events.
To disable Spring Integration instrumentation, set spring.sleuth.integration.enabled to false.
You can provide the spring.sleuth.integration.patterns pattern to explicitly provide the names of channels that you want to include for tracing.
By default, all channels but hystrixStreamOutput channel are included.
![]() | Important |
|---|---|
When using the |
If you want to customize the way tracing context is read from and written to message headers, -it’s enough for you to register beans of types:
Propagation.Setter<MessageHeaderAccessor, String> - for writing headers to the messagePropagation.Getter<MessageHeaderAccessor, String> - for reading headers from the messageWe instrument the RabbitTemplate so that tracing headers get injected
-into the message.
To block this feature, set spring.sleuth.messaging.rabbit.enabled to false.
We instrument the Spring Kafka’s ProducerFactory and ConsumerFactory
+it’s enough for you to register beans of types:
Propagation.Setter<MessageHeaderAccessor, String> - for writing headers to the messagePropagation.Getter<MessageHeaderAccessor, String> - for reading headers from the messageWe instrument the RabbitTemplate so that tracing headers get injected
+into the message.
To block this feature, set spring.sleuth.messaging.rabbit.enabled to false.
We instrument the Spring Kafka’s ProducerFactory and ConsumerFactory
so that tracing headers get injected into the created Spring Kafka’s
-Producer and Consumer.
To block this feature, set spring.sleuth.messaging.kafka.enabled to false.
We instrument the Zuul Ribbon integration by enriching the Ribbon requests with tracing information.
+Producer and Consumer.
To block this feature, set spring.sleuth.messaging.kafka.enabled to false.
We instrument the JmsTemplate so that tracing headers get injected
+into the message. We also support @JmsListener annotated methods on the consumer side.
To block this feature, set spring.sleuth.messaging.jms.enabled to false.
![]() | Important |
|---|---|
We don’t support baggage propagation for JMS |