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

Could not decode json type in spring cloud stream DefaultKafkaHeaderMapper

We are using spring-cloud-stream and planning to upgrade our Kafka version. Our applications using spring-cloud-stream:2.0.0 (spring-kafka 2.1.7) with apache kafka server 1.0.1 and also using spring-cloud-sleuth:2.0.0 for tracking. We are going to…
4
votes
0 answers

How to use spring cloud sleuth traceId in kafka consumers

I am using springboot 2.3.4, corresponding spring-kafka 2.5.6.RELEASE, springcloud sleuth 2.2.5, I use @KafkaListener to listen for Kafka messages, but during the test I found that the producer has a traceId, and I need the consumer to generate a…
jane
  • 61
  • 5
4
votes
1 answer

Zipkin traces in Prometheus

Small question about the possibility to integrate Zipkin with Prometheus. Currently, we have a working Zipkin instance fully ready, with its web UI. Zipkin is super cool, everything is fine. We are able to have all micro services sending traces to…
PatPanda
  • 3,644
  • 9
  • 58
  • 154
4
votes
1 answer

Getting error while starting zipkin server : Prometheus requires that all meters with the same name have the same set of tag keys

We have slueth in other microservices and we wants to send data to zipkin server for consolidated logging.I am trying to start my zipkin server.I am getting the following error: java.lang.IllegalArgumentException: Prometheus requires that all meters…
4
votes
3 answers

How to get request headers to be saved to MDC

I have a spring boot (2.2.5.RELEASE) project with spring-cloud-sleuth (Hoxton.SR3). I want to send a request to a controller containing a header and for this header to be: Populated in controller's span baggage (i.e.…
4
votes
2 answers

ShedLock not lock when Sleuth is present

There is an application that run some process by scheduler, like we have multiple instances we choose shedlock to block other run the same process. However, is not working since sleuth provides an instances of Runnable which is TraceRunnable and the…
nekperu15739
  • 3,311
  • 2
  • 26
  • 25
4
votes
2 answers

How to fix 'ClassNotFoundException: brave.propagation.CurrentTraceContext$ScopeDecorator'?

I used spring-cloud-starter-sleuth in my project. Then when it starts, it will show ClassNotFoundException:brave.propagation.CurrentTraceContext$ScopeDecorator This is a very beginning project with Spring boot 2.1.2.RELEASE and spring cloud…
Charlie Wang
  • 41
  • 1
  • 3
4
votes
1 answer

How spring cloud sleuth works?

How spring cloud sleuth works behind the scenes?. Will it be able to trace library calls also?. Im having a spring boot project A which uses library B. Any hit to endpoints in project A is traced by sleuth, but when I try to hit rest controller on…
Kiki
  • 43
  • 5
4
votes
2 answers

Whats wrong with this Async HystrixCommand?

I need to send notifications from time to time, I perform this task asynchronously. I'm using HystrixCommand as below to perform an asynchronous RestTemplate call which is not working: @HystrixCommand public Future notify(final Query…
4
votes
2 answers

How to log MDC with Spring Sleuth?

I have a Spring boot + sleuth based application. All works as expected. I have for now logs like this: 2017-05-04 17:55:52.226 INFO [alert,692d0eeca479e216,c3c8b680dc29ad02,false] 17292 --- [cTaskExecutor-1] c.k.a.b.s.alert.impl.AlertServiceImpl …
Franck Anso
  • 1,342
  • 4
  • 17
  • 34
4
votes
1 answer

Spring Boot custom starter for logging and distributed tracing

I'm working on a custom spring boot starter, with the purpose of providing an auto configuration for all the spring boot applications that we have in our distributed system, so this way, every time a configuration needs to be changed, it can be done…
saljuama
  • 2,906
  • 1
  • 20
  • 42
4
votes
1 answer

Sleuth doesn't show the trace id and the span id

I am trying to run a Spring Boot application and trace its execution with the support of Sleuth. The log shows the service name, but nothing for the trace id or the span id. All I get is [myservice,,,]. What am I missing? Here are some lines from…
msayag
  • 8,407
  • 4
  • 30
  • 29
4
votes
4 answers

Spring Sleuth integration for Apache Camel

Is there any Sleuth integration for Apache Camel in the wild? (with support for not only the correlation id but also the Span stuff)
Bertrand Renuart
  • 1,608
  • 17
  • 24
4
votes
1 answer

Spring Cloud Sleuth different trace-ID integrate with Kafka

I'm using Kafka for Asyng calls between microservices, and i'm using Spring Sleuth for logging. The logging is ok, but when there is a message from Microservice1 to Microservice2, the logging's messages have different Trace-ID. Don't they have to…
AleGallagher
  • 1,745
  • 7
  • 30
  • 40
4
votes
1 answer

Spring Cloud Sleuth error posting spans to Zipkin

Has anyone else encountered the following problem with using Zipkin & Spring Cloud Sleuth? Seems to be a problem posting out data to my localhost Zipkin server. Is there any need to configure proxy settings on Zipkin? 2016-11-17 12:13:59.270 DEBUG…
Dean Roulston
  • 79
  • 1
  • 2
  • 5
1 2
3
42 43