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
0
votes
1 answer

Span Customization with Google Cloud Sleuth 2

Is there a way to customize the Span inject and extractor for spring cloud sleuth 2? In the documentation of the version 1.2 i found a way that is not available on the new version(2). I think is because now its use Zipkin brave to take care of Span,…
0
votes
1 answer

getting 'Context Initialization' error when adding spring-cloud-sleuth to classpath

Portion of the build file that references spring-cloud-sleuth is provided below. dependencyManagement { imports { //where springCloudVersion = "Dalston.SR5" & springBootVersion = '1.5.9.RELEASE' mavenBom…
patb23
  • 387
  • 5
  • 21
0
votes
1 answer

spring-cloud-sleuth Trace via spring-cloud-stream with rabbitmq-binder: how to finish the Trace

I have setup a demo project using spring-cloud-stream with RabbitMQ-binders and spring-cloud-sleuth. dependencies { annotationProcessor "org.springframework.boot:spring-boot-configuration-processor" // for @ConfigurationProperties, make sure…
Dirk Hoffmann
  • 1,444
  • 17
  • 35
0
votes
2 answers

Sleuth Brave headers are not compatible with JMS spec

I am using Sleuth in Spring Integration project to pass along tracing headers across JMS messages. IBM MQ is used for Queue Manager. This configuration is working all fine functionally. However, all the Brave header X-B3-* are not compatible with…
CoderTR
  • 500
  • 3
  • 7
  • 19
0
votes
1 answer

how to exclude some calls with the Feign from tracing with the cloud sleuth

there's a microservice with spring-boot 1.5 which uses the Feign to communicate with others services, also there's spring-cloud-starter-zipkin which wrapped all calls through the Feign and sends tracing to zipkin server. The thing is i don't wanna…
slippery
  • 355
  • 2
  • 6
  • 13
0
votes
1 answer

CS/SC/CR/SR events from non sleuth applications

I also want to trace network latency from App -> Service1 -> App -> Service2. Spring sleuth works perferct to find latency between Sleuth aware services say services1->service2 as I can see CS,SR tags in Zipkin. Now I also want to track network…
Art
  • 414
  • 7
  • 24
0
votes
1 answer

How to use span name in logs instead of spanId in spring cloud sleuth?

I am using spring-cloud-starter-sleuth 2.0.0 M6 and due to breaking changes I cannot use my previous configuration which allows me to see the (human readable) span names in console logs instead of spanIds. I want to see…
destan
  • 4,301
  • 3
  • 35
  • 62
0
votes
1 answer

Spring sleuth Runtime Sampling and Tracing Decision

I am trying to integrate my Application with Spring sleuth. I am able to do a successfull integration and I can see spans getting exported to Zipkin. I am exporting zipkin over http. Spring boot version - 1.5.10.RELEASE Sleuth - 1.3.2.RELEASE Cloud-…
Art
  • 414
  • 7
  • 24
0
votes
0 answers

Spring sleuth generates 2 traceId s for one http request

I am using spring-cloud-starter-sleuth:1.3.2.RELEASE. For each request to the rest endpoint entires with two different traceId s are generated. Below is a sample log output for one complete request. two traceIds: ce67bb66181b4368 &…
crs
  • 91
  • 1
  • 1
  • 6
0
votes
1 answer

ZipkinStreamServer via kafka, org.springframework.messaging.converter.MessageConversionException

I'm using spring-cloud-sleuth and zipkin. In the producer, it worked.I can see message in kafka topic see image. but in the consumer,some exception occur. 2018-02-07 16:40:06.466 ERROR 936 --- [ -L-1]…
yokv
  • 5
  • 3
0
votes
1 answer

kafka producer always retry connect

I'm using spring-cloud-sleuth-stream and spring-cloud-starter-stream-kafka sending span to kafka,exception occur in connection. spring cloud version Edgware.SR1 spring cloud: stream: kafka: binder: brokers:…
0
votes
1 answer

Spring cloud sleuth dependencies throwing RibbonLoadBalancerClientException in Spring boot stack application

We are planning to integrate spring sleuth in our Spring cloud microservices application. However when a Service A makes a call to Service B using RestTemplate we are getting RibbonLoadBalancerClient exception. Please find the stack trace…
Gururaj Nayak
  • 636
  • 1
  • 9
  • 18
0
votes
1 answer

Run time tracing method execution - spring-cloud-sleuth provides

spring-cloud-sleuth provides way to trace method execution with @NewSpan As it is annotation it is not feasible to add annotation on all methods of project. Also, in production environment we only need to trace the method execution time once we find…
Nitul
  • 997
  • 12
  • 35
0
votes
1 answer

Spring Cloud Sleuth - disable sampling in distributed system

As per Spring Cloud Sleuth span Sampling we can control sampling rate. Samplers do not stop span (correlation) ids from being generated, but they do prevent the tags and events being attached and exported. By default you get a strategy that…
Nitul
  • 997
  • 12
  • 35
0
votes
2 answers

Continue Trace in downstream microservice

We are trying to add tracing to micro services so it can viewed in the google Stackdriver UI. We are using Java Springboot apps deployed into Kubernetes containers, each microservices communicates over http. We’ve seen that there is Sleuth and…