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

Integrating Spring Cloud Sleuth with Spring boot amqp

Looking for an example that shows integrating spring cloud sleuth with spring boot amqp (rabbit) publisher and subscriber. I do see the following messages in the log 2016-10-21 08:35:15.708 INFO [producer,9148f56490e5742f,943ed050691842ab,false]…
basu76
  • 441
  • 10
  • 19
4
votes
1 answer

spring-cloud-sleuth integration with spring-amqp

I am just making first steps with spring-cloud-sleuth and it works just fine with all kinds of http calls. Now I am trying to look at covering the messaging part as well. I saw that spring-cloud-sleuth integrates with spring-integration…
Mathias Dpunkt
  • 11,594
  • 4
  • 45
  • 70
3
votes
1 answer

Can I continue using brave headers in spring boot 3 with micrometer

I started migrating to spring boot 3, and also spring-cloud-sleuth to micrometer (https://github.com/micrometer-metrics/tracing/wiki/Spring-Cloud-Sleuth-3.1-Migration-Guide#samples). Added this dependecies:
3
votes
2 answers

Sleuth is not working with Spring Boot 3.0.0 Version

I am using Sleuth and Zipkin for distributed tracing and facing an issue. Issue: TraceID and SpanID is not getting printed in the microservice logs (and passed to Zipkin) with 3.0.0 version of Spring Boot. Following are the versions I am…
3
votes
1 answer

Spring Sleuth trace IDs are gone in Spring Cloud Gateway

I've got a very simple spring cloud gateway application (nothing custom, directly download from start.spring.io, just select gateway and sleuth). To enable access logs, I have to set the system property…
Rad
  • 4,292
  • 8
  • 33
  • 71
3
votes
1 answer

log4j vulnerability - Sleuth dependency

We heard that log4j-core.jar is vulnerable. We noticed that spring-cloud-starter-sleuth (version 2.2.2.RELEASE) dependency brings a dependency which uses log4j-core.jar (version 2.13.0) with provided scope as followed:
Yuval Simhon
  • 1,439
  • 2
  • 19
  • 34
3
votes
1 answer

traceId / spanId generated are changed post WebClient call

We are using ReactorNettyHttpTracing with our Spring Web + Spring WebFlux + Spring Cloud Sleuth application. The traceId / spanId generated are getting changed post the WebClient call. Spring Boot v2.6.1 and Spring Cloud v3.1.0 How do I retain the…
Rayyan
  • 107
  • 12
3
votes
2 answers

Spring Cloud Sleuth stopped pushing X-B3-TraceId into MDC after spring-boot/spring cloud upgrade

I have upgraded my Spring boot dependencies from 2.1 to 2.4.5 and spring cloud to 2020.0.2. After this upgrade, my MDC context is not populated. Any ideas of what should be done here?
Ihor M.
  • 2,728
  • 3
  • 44
  • 70
3
votes
1 answer

Exporting Spring Cloud Sleuth spans automatically using Azure Monitor OpenTelemetry Exporter client library for Java

I'm trying to use Azure Monitor OpenTelemetry Exporter client library for Java to export all traces/spans from Spring Cloud Sleuth to Azure Monitor. This integration seems to only work with the newest version of Spring Cloud Sleuth after the recent…
3
votes
1 answer

App is failing with "required a bean of type 'brave.Tracer' that could not be found" while trying to get Sleuth's trace

I am calling my Springboot app from another micro service to get the trace & span id's but getting error while starting the app. What I want to do is create Trace & Span in app1 and then call app2 and get the Trace id passed from app1 in app2. In…
vicky
  • 149
  • 2
  • 7
  • 21
3
votes
1 answer

spring boot with p6spy sleuth traces interpretation

We have been using spring cloud sleuth in our micoservices for tracing. We have also added enabled jdbc level spans from spring data Repository connection, fetch and query. I am seeing some weird jps traces of name jdbc:/datasource/connection which…
v78
  • 2,803
  • 21
  • 44
3
votes
0 answers

Sleuth Tracing doesn't work with Spring JMS

I have 2 services, I'm trying to add log correlation with sleuth. first service: spring-boot version:1.5.9.RELEASE second service: spring-boot version:1.5.3.RELEASE the first service sends to the second service 2 messages, one via HTTP and one via…
israel berko
  • 556
  • 1
  • 5
  • 18
3
votes
0 answers

Spring Boot app with Spring Cloud Sleuth integration with Jaeger in Istio

I would like to know what's the minimal configuration for a spring-boot app in terms of dependencies if I need to report traces to Jaeger in Istio. I was expecting that by adding only org.springframework.cloud
3
votes
0 answers

Spring Sleuth upgrade and adding custom trace ID

I've been trying to upgrade my Spring Cloud Sleuth from version 1.3.3-Release to 2.2.0-Release. We were using HTTPSpanInjector and HTTPSpanExtractor which have since been deprecated. I have pasted my current code which needs to be upgraded I have a…
shubhendu_shekhar
  • 1,373
  • 2
  • 9
  • 13
3
votes
0 answers

Spring Cloud Sleuth with Reactor Kafka

I'm using Reactor Kafka in a Spring Boot Reactive app, with Spring Cloud Sleuth for distributed tracing. I've setup Sleuth to use a custom propagation key from a header named "traceId". I've also customized the log format to print the header in my…