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 Malformed ID Exception

I have a service A which calls my service B which is on spring boot. Service A passes a request header with key X-B3-TraceId and value 1f99a12d-066e-4aac-a71a-e7d42d7fa7a3 but the sleuth gives the following exception: 2020-12-08 20:18:21,821 [XNIO-2…
Harshit Gupta
  • 167
  • 1
  • 1
  • 10
0
votes
1 answer

Zipkin and Sleuth integration for non spring boot projects

Can anyone tell me, is there any way to integrate Zipkin (if possible Sleuth also) for non-spring boot projects? I am trying to integrate Zipkin for my traditional spring application. It is not a microservice. How could I do this? Any suggestions,…
0
votes
1 answer

How to remove X-B3 prefix form Sleuth logs

I want to remove X-Span-Export":"true","X-B3-SpanId":"40bcdc1c4fcdb9c0","X-B3-TraceId":"40bcdc1c4fcdb9c0"} form my log . I have added below configuration to application.yml but no help. Application.yml spring: application: name: app-name profiles:…
user14528173
0
votes
1 answer

Spring Cloud Sleuth increased startup time

I am using spring-cloud-sleuth for adding correlation id to my logs for http requests, rabbitMQ messages and sheduled events. After adding dependency app startup time increased by 50 %. All other configuration properties like…
erdn
  • 33
  • 1
  • 4
0
votes
1 answer

Spring Sleuth Zipkin Extra Field Propagation

I am new to distributed logging and I need help around the propagation of extra fields across Http Request and Messaging Request. Currently, I am able to propagate the traceId and spanId, but I need to pass correlationId to be propagated across all…
Atul
  • 133
  • 3
  • 12
0
votes
0 answers

Trace Id not getting sent correctly between spring boot apps

I have a spring boot console app that sends a http request to a spring boot api, the trace id looks correct in the console app, but is a completely different trace id in the api side. Why would this happen? Do I need to inject something into the…
danjonesgh
  • 93
  • 2
  • 9
0
votes
1 answer

Spring cloud Sleuth starts a new trace instead of continuing spans in a single trace

I have 4 spring-boot applications (A, B, C and D). The lifecycle of a transaction is as follows : Application A is a kafka streams application and it ultimately produces to a topic which is consumed by Application B. Application B then consumes…
0
votes
1 answer

Is Sleuth tracing supported in Azure AKS?

I have an application that is going to provide tracing data with Spring Cloud Sleuth. I want to get this trace data to Azure Application Insights. From Azure's documentation I understand that Sleuth traces are natively supported if I deploy my…
0
votes
1 answer

How to force Zipkin/Brave/Spring-Cloud-Sleuth span to be exportable?

How can I force a Zipkin span to be exportable? In below code spans are sometimes exportable, sometimes not in a non repeatable manner. It seems to me that if I comment first scopedSpan, than second manually created spanInScope is exportable, but…
bastiat
  • 1,799
  • 2
  • 19
  • 38
0
votes
0 answers

How to show custom log messages in zipkin server

We have spring-cloud-starter-sleuth and spring-cloud-starter-zipkin dependencies in in other microservices and we are able to see the traces on the zipkin dashboard. We also want to show the custom messages on zipkin i.e whatever log messages we are…
0
votes
1 answer

Spring JMS consumer does not have parent span Id rightly set

My sample application makes use of spring-boot-starter-activemq (2.3.1) spring-boot-starter-web (2.3.1) pring-cloud-starter-sleuth (2.2.3) On the published message I see the X-Parent-Span-Id, X-Trace-Id and b3 properties rightly set. However the…
Ajay
  • 465
  • 1
  • 9
  • 22
0
votes
0 answers

How to integrate splunk with spring cloud sleuth in Spring Boot project?

we are developing microservices using spring boot. we want to track the progress of microservices using Spring Cloud Sleuth and wants to show that logs using Splunk on some dashboard etc. For demo purpose we have are building three services, Service…
0
votes
1 answer

Error while Autowiring Tracer in Service Spring Boot

I have autowired org.springframework.cloud.sleuth.Tracer in a service but getting the following error while building the project (mvn clean install). Although The applications runs through IDE and code works perfectly, but I need a way to remove the…
Shreya Sharma
  • 175
  • 1
  • 2
  • 12
0
votes
1 answer

Sleuth spainId is null in webfulx

I want to add sleuth traceId and spanId to response headers. And I try to do it in WebFilter, similar to suggestions in the documentation. But in filter currentSpan is yet null, latter in controller traceId and spanId I are present in logs. How can…
Balconsky
  • 2,234
  • 3
  • 26
  • 39
0
votes
1 answer

How I can use Sleuth Span in spring boot 2

Trying to upgrade from spring boot 1 to 2, The problem I'm facing is with tracing In spring boot 1, we are using sleuth Trace that seems like deprecated in the spring boot 2 and suggesting to use 'brave'. One of the problems is our another…
Srinath
  • 3
  • 1
  • 4