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

Send TraceId across Threads

We have a distributed application following microservice Architecture. In one of our microservice we are following producer-consumer pattern. The producer receives requests, persists it to database, pushes the request into a BlockingQueue and sends…
Apurv
  • 315
  • 5
  • 14
3
votes
2 answers

ZipkinSpanReporter is not working properly

i am trying to evaluate zipkin to enable distributed tracing capability for all our micro-service. Below are versions in my setup. Spring-boot version: 1.5.7.RELEASE spring-cloud version: Camden.SR6 zipkin version : 2.2.1 Configuration for seluth…
Joey Trang
  • 1,105
  • 2
  • 23
  • 44
3
votes
1 answer

spring-cloud-sleuth in a reactive environment

I should say I'm really impressed with the simplicity and usefulness of spring-cloud-sleuth and zipkin. However, I'm working on a POC for which I'm considering reactive toolkits. Vertx 3 is the first item in my list to try (with spring cloud…
user1189332
  • 1,773
  • 4
  • 26
  • 46
3
votes
1 answer

How to propagate sleuth traceid,spanid to aws lambda function

I want to trace a request which comes to my webservice and sends an sns notification which will trigger a aws lambda function. Any way to create a new span with same trace id in my lambda function.
3
votes
1 answer

How to add information to every span with Spring Cloud Sleuth

I am currently trying to understand how I can customize Spring Cloud Sleuth in a scalable way to add information to every Span. What I have tried so far: Using my own implementation of GenericFilterBean and HandlerInterceptorAdapter, give them a…
LST
  • 345
  • 4
  • 13
3
votes
1 answer

How can I create a Spring sleuth application without Spring boot

I am trying to work on a Poc for creating a sleuth application for our project for logging with Spring mvc i.e, without Spring Boot. I am not able to find my docs/material on the web for mvc. So, how can I create the Tracer, span bean and inject…
Jameel
  • 37
  • 2
2
votes
1 answer

TraceId in not getting pushed in logs when using micrometer

I am working on a demo project to enable distributed tracing on logs. I initially started with sleuth, but later on figured out that it is being migrated to micrometer(Sleuth is not compatible with spring boot 3.x) But out of my surprise I am not…
2
votes
0 answers

How to manage tracing with Spring WebClient in Reactive way?

I have a method in EventService that calls an API and handle errors if there is any. private Mono send(String accountId) { accountIdBaggageField.updateValue(accountId); logger.info("making the call"); Mono res =…
2
votes
2 answers

Migrating Sleuth to Observation API by Micrometar Spring Boot 3.0.0

We have Sleuth enabled on all endpoints Spring 2.7.x ( that comes out of the box). Just plain and simple traceId/spanId tracking. Now as in Spring Sleuth is no more available in Spring Boot 3.0.0. Is there a way to enable this new Observation Api on…
2
votes
0 answers

Spring Cloud Sleuth - not propagating baggage for Spring Kafka

I have two microservices using Kafka as a broker for the communications between them and using Spring Cloud Sleuth for tracing and both of them have the same Spring boot version 2.7.2. I needed to pass extra information (e.g. correlationId) for the…
2
votes
1 answer

Spring cloud sleuth - tracing from FE to BE

I'm using springboot 2.7.5 and spring cloud sleuth 3.1.5 I have a distributed system composed by more than 30 microservices. I have an Angular front-end deployed in a ngninx container and from this FE I call all my MS. I don't use an API GW What I'd…
Angelo Immediata
  • 6,635
  • 4
  • 33
  • 65
2
votes
1 answer

Add Instana traceId to spring boot logging

I have an application landscape where we use Instana agents to monitor and trace the applications. To be able to correlate an application log to a trace I'd like to add the traceId from Instana into our logs. Now I've tried to add…
tomhier
  • 570
  • 1
  • 5
  • 15
2
votes
0 answers

Spring cloud sleuth for propagating baggage with otel configuration

I am using spring cloud sleuth for propagating baggage with otel configuration. I want to send baggage with extra fields across applications. I am following this…
2
votes
1 answer

TracingKafkaClientSupplier error "Implementations of KafkaClientSupplier should implement the getAdmin() method"

I'm upgrading a Spring Boot application to Boot 2.6.1, Cloud 2021.0.0 and Cloud Stream 3.2.1. This application has a bunch of KStreams such as: @Bean fun processEvent() = Function, KStream
2
votes
1 answer

Spring Sleuth/Feign disable header propagation on specific conditions

I'm working on an app that uses Spring Sleuth and Feign to propagate headers between incoming and outgoing rest requests automatically. We want to restrict this blanket behaviour (as headers are forwarded on all downstream calls) and remove a…
Augusto
  • 28,839
  • 5
  • 58
  • 88