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
6
votes
2 answers

How did Spring Cloud Sleuth add tracing information to logback log lines?

I have web application based on Spring Boot and it uses logback for logging. I also inherit some logback defaults from spring boot using: I want to start logging tracing…
Patrik Mihalčin
  • 3,341
  • 7
  • 33
  • 68
6
votes
1 answer

Difference between Zipkin and Elastic Stack(ELK)?

Spring Cloud Sleuth is used for creating traceIds (Unique to request across services) and spanId (Same for one unit for work). My idea is that Zipkin server is used to get collective visualization of these logs across service. But I know and have…
6
votes
1 answer

Spring boot Static inner class not initialised when application starts as a jar

When I start up the my spring boot application via intellij, the following class initialised properly and the log can be seen. but if I run agains the jar from the build, MyCurrentTraceContext seem not initialised and I can't see the log in the…
user1619397
  • 680
  • 2
  • 11
  • 23
6
votes
2 answers

How to implement Sleuth Tracing With Feign.Builder?

I'm trying to integrate Sleuth into our system. If I use interfaces annotated with @FeignClient, everything works fine. These interfaces get instrumented automatically, and Sleuth headers get propagated with REST calls. But, we have some existing…
6
votes
0 answers

How to configure Sleuth to trace AWS SQS queues

I am trying to trace Spring cloud integration aws + AWS SQS app with Sleuth. The receiver receives message from SQS after a message is added to queue. The log has app name, but no trace id and span id while receiving message from sql queue. Here is…
Mike
  • 61
  • 1
  • 3
6
votes
2 answers

app fails to start when sleuth and zipkin are added

I have a Spring Boot app that I'm updating to 1.5.1. It works great, until I add Sleuth and Zipkin to classpath org.springframework.cloud spring-cloud-starter-sleuth
Luiz E.
  • 6,769
  • 10
  • 58
  • 98
5
votes
2 answers

SpringBoot 3.0.0-M1 + SpringCloud 2022.0.0-M1 [ERROR] 'dependency.version' for org.springframework.cloud:spring-cloud-starter-sleuth:jar is missing

With the exciting releases of both SpringBoot 3.0.0-M1 and SpringCloud 2022.0.0-M1, I went ahead to bump the versions…
PatPanda
  • 3,644
  • 9
  • 58
  • 154
5
votes
0 answers

Spring Cloud Sleuth with Elastic APM

Is it possible of providing the Tracers and Spans of Spring Cloud Sleuth (for a Webflux project) to Elastic APM? I've seen a discussion of the issue here in the context of Spring Webflux. And here in the context of Spring Cloud Sleuth.
5
votes
1 answer

Using Feign builder requests doesn't send trace-id, span-id to child clients but using rest template is showing all headers on child clients

I'm making a sequential request using Feign Builder. There are no x-b3-traceid,x-b3-spanid .. in the title of the request. That's why the log my last client appears on the zipkin. I use spring boot 2.4.2 , spring cloud 2020.0.0 , feign-core 10.10.1…
5
votes
2 answers

How to init a default trace context with span in controller when using SpringBootTest

I'm making a move from Spring Boot 1.5.21 to 2.2.5, and in the process also moving from spring-boot-cloud version Edgware.SR6 to Hoxton.SR3. This move forced me to ditch the sleuth's own implementation of tracer/span model and embrace the new model…
5
votes
1 answer

Why Sleuth doesn't work with Log4j2 in my Spring Boot service

I have one question - why Sleuth doesn't work with Log4j2? I have excluded default logging library and added Log4j2 to use some other features like these in application.properties filr" logging.file=myservice.log logging.file.max-size=…
Matley
  • 1,953
  • 4
  • 35
  • 73
5
votes
2 answers

Spring Sleuth and Zipkin:Could not find artifact io.zipkin.brave:brave-bom:pom:4.16.3-SNAPSHOT

I have a Spring Boot 2.0.0 REST service where I'm trying to enable Sleuth and Zipkin to send traces to my localhost Zipkin server. The app worked fine unti I add the two dependencies spring-cloud-starter-sleuth and spring-cloud-sleuth-zipkin to my…
urig
  • 16,016
  • 26
  • 115
  • 184
4
votes
1 answer

Brave Baggage not working after switching from spring-cloud-sleuth to micrometer-tracing

I am updating my spring project to newer versions, and after updating I got the following message: Your project setup is incompatible with our requirements due to following reasons: Spring Cloud Sleuth is not compatible with this Spring Cloud…
Dfarrelly
  • 695
  • 2
  • 7
  • 24
4
votes
1 answer

Propagate Sleuth baggage on parallel streams

This question is exactly the same as this one, which wasn't actually answered (that code only uses one thread). My code looks like this at the moment CompletableFuture completableFuture = CompletableFuture.supplyAsync(() -> { …
dcolazin
  • 831
  • 1
  • 10
  • 25
4
votes
2 answers

Implement trace-id with Spring Webflux

I'd like to generate unique traceId per request and pass it through all services. In Spring MVC it was fairly easy by using MDC context and putting traceId in header, but in reactive stack it isn't working at all because of ThreadLocal. In general…
Faelivrinx
  • 101
  • 1
  • 2
  • 9
1
2
3
42 43