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

Sleuth TraceId gets lost in Spring State Machine

I'm struggling with a problem regarding Spring State Machine and Spring Cloud Sleuth. After emitting event to change the state of my state machine, I'm not able to see the traceId anymore. The traceId just get lost. As example, I have a simple State…
0
votes
1 answer

Add HTTP request parameters to Spring sleuth for propagation

I have some http request parameters which i need to add as propagation keys in spring-sleuth. Note : I know spring-sleuth add headers by default. I need to inject http request patameters too. Any help will be apprecieted.
Zeeshan
  • 1,173
  • 5
  • 19
  • 26
0
votes
0 answers

Spring Sleuth ignore "get /**" either by pattern or "mvc.controller.class"

TLDR : How can we ignore sending traces to jaeger (or zipkin) where the header is "get /**", and if that is not possible ignore sending traces where "mvc.controller.class" is "RequestHttpRequestHandler" We have a app which uses spring sleuth, in…
MilindaD
  • 7,533
  • 9
  • 43
  • 63
0
votes
1 answer

jetty ShutdownThread memory leak with spring batch

I'm using spring batch to read a csv file and perform a feign call for every row of the file. This is the core class for my Job: package it.nexi.digitalreview.batch.config; import…
0
votes
1 answer

Sleuth traceId cannot propagate in Quartz job

I'm working on a Spring Boot project with spring-boot-starter-quartz and recently I have added spring-cloud-starter-sleuth to add traceId for each request. However, when a job is automatically triggered by the system, it cannot propagate traceId…
0
votes
1 answer

How to print traceId and spanId with brave tracing?

Earlier i used to write below code with spring boot 1.5.12 :- import org.springframework.cloud.sleuth.Span; import org.springframework.cloud.sleuth.Tracer; @Autowired Tracer tracer; Span span = this.tracer.getCurrentSpan(); …
avinash kumar
  • 475
  • 6
  • 10
0
votes
1 answer

Zipkin & Sleuth, Tracer missing the createSpan method

I am following the tutorial for creating tracing application zipkin and sleuth but I am having some trouble. I cannot create a span. The problem is that the method does not exist. Also I cannot find the import for the tracer. This is what I am…
user13427898
0
votes
0 answers

The import org.springframework.cloud.sleuth.Sampler cannot be resolved

I am working on Spring Boot and Cloud Sleuth, migrating from Spring Boot v1.4.1.RELEASE to Spring Boot 2.2.6.RELEASE. When I upgraded maven dependency, my code started breaking CustomSampler.java import…
PAA
  • 1
  • 46
  • 174
  • 282
0
votes
1 answer

Spring cloud sleuth Annotations: Autowiring doesn't work

I have Spring cloud sleuth(and also zipkin) configured in my application. I have a controller which calls service, which in turn calls repository and finally database. The setup works fine, Sleuth is generating span id's and It is visible in…
pvpkiran
  • 25,582
  • 8
  • 87
  • 134
0
votes
0 answers

Spring, RabbitMQ, Sleuth and Zipkin: No tracings available in Zipkin

Im trying to implement distributed tracing using Spring, RabbitMQ, Sleuth and Zipkin. So I added the dependencies: org.springframework.cloud
Mulgard
  • 9,877
  • 34
  • 129
  • 232
0
votes
2 answers

How to integrate Sleuth in a spring boot 1.5 to propagate trace id in newer spring boot 2.2?

We have a microservice architecture built with Spring Boot 2.2 and we are using Spring Cloud Sleuth to propagate the trace id. However, we have one old huge monolithic built with Spring Boot 1.5.2 that it is not using Sleuth (upgrading this…
Federico Piazza
  • 30,085
  • 15
  • 87
  • 123
0
votes
1 answer

How to log the trace id using Springboot custom filters

I have few custom filters in my Springboot Webflux API. This project has been activated with Spring Sleuth, however, these filters are not logging the trace and span ids in the log messages. I made sure that the order was set properly for these…
0
votes
0 answers

custom baggage key not showing up in logs with Spring cloud sleuth

Not seeing custom baggage id in the spring boot micro-service logs. Below are the steps followed. 1. Used spring-cloud-starter-sleuth 2.2.1.release with springboot 2.2.0. Snippet from pom-
kumar
  • 1
  • 1
0
votes
1 answer

Java micro service distributed tracing with Istio

Kubernetes and Istio already installed in the cluster. Three micro services deployed as PODs. The flow is Micro service A to Micro Service B calls => HTTP Micro service B to Micro service C calls => via Kafka Micro service A expose a HTTP API to…
era
  • 391
  • 4
  • 24
0
votes
3 answers

Spring sleuth Baggage key not getting propagated

I've a filter (OncePerRequestFilter) which basically intercepts incoming request and logs traceId, spanId etc. which works well, this filter lies in a common module which is included in other projects to avoid including spring sleuth dependency in…
Akhil
  • 1,184
  • 1
  • 18
  • 42