Questions tagged [spring-cloud-sleuth]

Spring Cloud Sleuth implements a distributed tracing solution for Spring Cloud, borrowing heavily from Dapper, Zipkin and HTrace.

For most users, Sleuth should be invisible, and all your interactions with external systems should be instrumented automatically. You can capture data simply in logs, or by sending it to a remote collector service.

A Span is the basic unit of work. For example, sending RPC is a new span, as is sending a response to an RPC. Span’s are identified by a unique 64-bit ID for the span and another 64-bit ID for the trace the span is a part of. Spans also have other data, such as descriptions, key-value annotations, the ID of the span that caused them, and process ID’s (normally IP address). Spans are started and stopped, and they keep track of their timing information. Once you create a span, you must stop it at some point in the future. A set of spans forming a tree-like structure called a Trace. For example, if you are running a distributed big-data store, a trace might be formed by a put request.

Spring Cloud Sleuth features:

  • Adds trace and span ids to the Slf4J MDC, so you can extract all the logs from a given trace or span in a log aggregator.

  • Provides an abstraction over common distributed tracing data models: traces, spans (forming a DAG), annotations, key-value annotations. Loosely based on HTrace, but Zipkin (Dapper) compatible.

  • Instruments common ingress and egress points from Spring applications (servlet filter, rest template, scheduled actions, message channels, zuul filters, feign client).

  • If spring-cloud-sleuth-zipkin is available then the app will generate and collect Zipkin-compatible traces via HTTP. By default, it sends them to a Zipkin collector service on localhost (port 9411). Configure the location of the service using spring.zipkin.baseUrl.

638 questions
3
votes
0 answers

Application with Spring Cloud Sleuth reporting to Jaeger with OpenTracing is not using the BraveTracer

Following Spring Cloud Sleuth's documentation I've set up a Spring Boot application with a Zipkin client: Gradle config: "org.springframework.cloud:spring-cloud-starter-sleuth", "org.springframework.cloud:spring-cloud-starter-zipkin" With this I…
codependent
  • 23,193
  • 31
  • 166
  • 308
3
votes
1 answer

Use Sleuth trace-and span id in log4j2 patternlayout

I want to use sleuth with log4j2. Therefor I used the .properties configuration. The problem is I can't get the sleuth parameters to the logs with my patternlayout. Can you tell me which pattern to use to get the sleuth parameters. In my case they…
FishingIsLife
  • 1,972
  • 3
  • 28
  • 51
3
votes
0 answers

Spring Cloud Sleuth Rabbit integration seems to create new TraceId on send

my goal is to maintain the traceId (of a brave.Span) between a rabbitMq sender and consumer. In order to achieve this I use spring-cloud-sleuth autoconfigured in version 2.1.0.RELEASE When creating a span and eventually sending a message over…
Tom AsIdea
  • 61
  • 4
3
votes
1 answer

Java based Logback Configuration

I got stuck with java based logback configuration via beans. As observed, the configuration is not even loading. Would be great if anybody can guide me to make it resolved. Attaching the code below. public class…
3
votes
1 answer

BeanNotOfRequiredTypeException when using spring-JMS and spring cloud slueth

I have spring boot project(2.1.0 Release) with Spring Cloud sleuth. Spring Sleuth's TracingConnectionFactoryBeanPostProcessor is overiding ConnectionFactory bean with LazyConnectionFactory Bean.As a result,I am…
swathi manda
  • 101
  • 1
  • 7
3
votes
1 answer

128 bit Sleuth Trace ID on PCF

I am trying to use the 128 bit Sleuth generated TraceId as a unique identifier for request hitting my controller. I understand that the default traceId is 64 and to change it, I have to add the following to the…
Yan Han
  • 31
  • 3
3
votes
1 answer

How to resolve RabbitMQ Server connection error in Spring-cloud-sleuth-zipkin (Edgware.SR5)

I need to send spans through RabbitMQ to Zipkin. I'm Using Spring-Cloud-Sleuth Edgware-SR5 version and SpringBoot 1.5.3.RELEASE versions. With older Spring-cloud sleuth version (spring-cloud-stream-binder-rabbit - v1.1.4.RELEASE) it was working…
3
votes
3 answers

Spring boot 2.0.5.RELEASE - sleuth and mockito

I have tried to sort this out for a week, but no luck at all. The issue is with the unit tests. This is the class that I am trying to test: import brave.Span; import brave.Tracer; @Service public class InternetBackEndRestClient { @Autowired …
3
votes
1 answer

Missing bean 'zipkin2.reporter.Sender' when using `@AutoConfigureAfter(TraceAutoConfiguration.class)`

TLDR : Repro project here : https://github.com/snussbaumer/zipkin-app-wont-start-repo I want to use a Zipkin Kafka Sender I also need a piece of AutoConfiguration to run after TraceAutoConfiguration from Sleuth If I use @AutoConfigureAfter the…
3
votes
3 answers

Spring cloud sleuth did not run with Zipkin

first i had a small issue with this class brave.sampler.Sampler could not import this class, only imported when i added this dependency io.zipkin.brave brave
3
votes
1 answer

Spring Sleuth | Create fresh new (detached/orphaned) Trace

I got a Spring Boot application making use of Spring Sleuth for tracing inter-service calls. Within that application a ScheduledExecutorService exists that performs http requests in a loop (pseudo-code below): class HttpCaller implements Runnable { …
Marc-Christian Schulze
  • 3,154
  • 3
  • 35
  • 45
3
votes
2 answers

How to log MDC with Spring Sleuth 2.0?

referring to quesition/answer in How to log MDC with Spring Sleuth? I think this has/will change(d) with spring-cloud 2.0 as there is no SpanLogger or Slf4jSpanLogger anymore (or I don't find it) Wouldn't it be nice if application properties…
Dirk Hoffmann
  • 1,444
  • 17
  • 35
3
votes
0 answers

slueth with rxjava2 creating multiple traces

I am using spring cloud slueth with zipkin in spring boot to trace the services calls. My spring cloud version is Edgware.RELEASE Now I when I tried to trace my facade layer which uses rxjava, it creates 12 traces for a single request? What should I…
Ankit Bansal
  • 2,162
  • 8
  • 42
  • 79
3
votes
0 answers

Spring Cloud Sleuth instrumentation for Spring-WS (SOAP) services

Is there a way to instrument a SOAP web-service (written with Spring-ws) using Spring Cloud Sleuth? It doesn't seem to work out of the box like REST services do. Any pointers on how to wrap Sleuth instrumentation around it would be appreciated.
Ian Cccc
  • 41
  • 3
3
votes
3 answers

Best way to pass custom headers along with Sleuth X-B3* headers

As per the README here , I am using the following configuration to pass x-vcap-request-id and x-vcap-group-id from one application to the other. @Bean public Factory propagationFactory() { return…
CoderTR
  • 500
  • 3
  • 7
  • 19