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

Spring Sleuth trace/span IDs not available in HttpTraceRepository only if Mono response has body

I have logging in an Actuator HttpTraceRepository bean which is invoked after a Mono response has been written. If the response has no body (only status) then I get the trace/span IDs in the log message. If however the response has a body, the log…
Adam Michalik
  • 9,678
  • 13
  • 71
  • 102
0
votes
1 answer

Sleuth not working for websocket client

I have a microservice which is connecting to the WebSocket server, and receiving the messages from the server. I want to integrate Sleuth in this application, as this is the gateway for my set of microservices. But when I connect to the WebSocket…
krmanish007
  • 6,749
  • 16
  • 58
  • 100
0
votes
1 answer

Spring cloud sleuth doesn't work with log4j2

When i add sleuth dependency in a spring boot project that uses log4j2 for logging, i get the following error Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/boot/context/embedded/FilterRegistrationBean Does sleuth…
Hary
  • 1,127
  • 4
  • 24
  • 51
0
votes
0 answers

Spring Cloud Sleuth is using same trace Id

I have enabled the sleuth in my application, and I started getting the log with traceId and spanId but I am getting the same traceId for all the various logs. My input source is a message Listener, so it might be all handled with a single thread, so…
krmanish007
  • 6,749
  • 16
  • 58
  • 100
0
votes
1 answer

zipkin asynch span every second

We have a spring-boot application (spring-boot-starter-parent-2.0.0.RELEASE) using spring-cloud-starter-zipkin for writing "spans" to zipkin. We use spring-integration too (through spring-boot-starter-integration) and we have added an integration…
jalogar
  • 1,604
  • 19
  • 27
0
votes
1 answer

Using Spring's Sleuth for MDC when working with other microservices frameworks

The Spring's Sleuth seems like a good solution for MDC (Mapped Diagnostic Context) when working with only Spring Boot microservices. But we are wondering if it can useful when every microservice is built with a different framework (dropwizard, java…
riorio
  • 6,500
  • 7
  • 47
  • 100
0
votes
0 answers

spring-cloud-sleuth with Zipkin with Kafka

I'm using spring-cloud's sleuth with zipkin with kafka. here is my pom.xml configure. org.springframework.cloud spring-cloud-starter-zipkin
0
votes
1 answer

Disable sleuth for from storing some traces

I am using spring cloud finchley.rc2 with spring boot version 2 along with sleuth and zipkin. I have a facade layer which uses reactor project. Facade calls services parallel and each service store some tracing info in rabbit mq. Issue is I am…
Ankit Bansal
  • 2,162
  • 8
  • 42
  • 79
0
votes
1 answer

Name an external dependency in Zipkin to have it drawn

I am using Zipkin with Spring Sleuth to display traces. When I use it locally, http://localhost:9411/zipkin/dependency/ displays a nicely created graph of dependencies within the eco-system. Sometimes, backends from outside that eco-system get…
user3105453
  • 1,881
  • 5
  • 32
  • 55
0
votes
1 answer

Sleuth instrumentation of Spring cloud stream messages is lost when using zipkin + kafka

I have the following setup : several Spring Cloud Edgware services with most notably the spring-cloud-starter-zipkin and spring-cloud-stream-binder-kafka dependencies. a Zipkin server running the openzipkin/zipkin:2.8 docker image I see traces…
0
votes
0 answers

Spring cloud sleuth Propagating Span Context

I am trying to add span context like below, with spring boot 2.0 and sleuth version 2.0.RC1/2.0.RC2 Span initialSpan = _tracer.nextSpan().name("span").start(); try( Tracer.SpanInScope ws = _tracer.withSpanInScope(initialSpan) ) { …
Chandra
  • 1
  • 2
0
votes
1 answer

How to fill Spring Cloud Sleuth Trace ID into logRef field of VndError in spring-hateoas?

I have a @ControllerAdvice which is returning VndError from spring-hateoas. VndError specifies a logRef field which is where I should be putting the Trace ID from Spring Cloud Sleuth. Is there an official way to do this, or should I just retrieve…
0
votes
0 answers

Manually joining a trace created by a controller to a different trace in Sleuth

My system consists of a 3rd party server, to which I send a POST request, and the server sends back a POST request when it finishes calculating the result. My project consists of Spring Cloud Stream applications, and I want this whole operation to…
0
votes
1 answer

Spring Cloud Zipkin with RabbitMQ not persisting in MYSQL

I have done all the possible matches and mix-up of dependency and still not able to record traces in zipkin ans store it in MYSQL using RabbitMQ. Still i can see the trace and span id's in console and nothing beyond this. Someone please take a look…
0
votes
1 answer

spring-cloud-sleuth with opentracing

I'm using the latest milestone of spring-cloud-sleuth and I can't seem to get traces emitted through opentracing. I have a Tracer bean defined and spring boot seems to acknowledge that, but no traces are being emitted. Is there a way to check if…
wooder
  • 25
  • 5