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

Sending Zipkin Spans for @FeignClient

I'm running a Spring Boot app using: Spring Boot 2.3.8 Spring Cloud Hoxton.SR10 I've declared the spring-cloud-starter-zipkin and spring-cloud-starter-openfeign dependencies, and have configured my app to point to a Zipkin server. Its a pretty…
0
votes
1 answer

Spring sleuth not creating new traceid inside a spring scheduler

I am scheduling the spring scheduler with SchedulingConfigurer as follows. However, new traceid is not getting created every time the "ProcessJob" method is getting called. Even following method always logs with the same traceid. …
Alagesan Palani
  • 1,984
  • 4
  • 28
  • 53
0
votes
1 answer

Spring Cloud Sleuth: Export data from remote system to local Zipkin

In my Spring Boot application I use spring-cloud-starter-sleuth (Version Hoxton.SR10) for tracing. It is (still) a monolithic application so I widely use the @NewSpan annotation for creating new spans. In my development environment I also use…
Rokko_11
  • 837
  • 2
  • 10
  • 24
0
votes
1 answer

How do I get the current Trace ID in a Spring Cloud Gateway GlobalFilter

Similar to Spring Cloud Sleuth- Get current traceId? but in the context of Spring Cloud Gateway GlobalFilter I tried to inject Tracing and get the currentTracingContext but it returns null when I get the current tracing context. @Autowired …
Archimedes Trajano
  • 35,625
  • 19
  • 175
  • 265
0
votes
1 answer

Spring sleuth and spring integration generating the same traceId for all outbound API requests

I'm building a springboot app which use spring integration and spring sleuth as well. The app reads from a csv file and for each record in the csv file a call is made to an API using spring resttemplate. Each time a file is read, all corresponding…
0
votes
1 answer

How to implement trace service to service using spring webflux?

I am implementing service to service integration that using spring webflux. Each microservice is isolated and running a different port. I would like to see an end to end trace using jaeger. The problem is each service is capturing trace without…
0
votes
0 answers

Problem sleuth with spring-cloud-stream, kafka and avro

I implementing a microservices using kafka cloud-stream with avro when I put Sleuth dependency the OUTPUT of the Function, the producer couldn't serialize avro. Dependency in gradle.build: import…
0
votes
1 answer

How to tag a subtree of spans in Spring Cloud Sleuth? Or, how to sub-divide traces?

When a sender sends a post, I need to notify multiple subscribers. In this case, "sender sends a post" is a HTTP post and create a trace. My goal: When looking at my logs, I will know "which subscriber is the method creating this log notifying". My…
ch271828n
  • 15,854
  • 5
  • 53
  • 88
0
votes
1 answer

Filtering information in Google Cloud Traces from different gke clusters in same GCP project

I have one GCP project in which there are two GKE clusters, one for development and preproduction workloads and another one for production. I am using Google Cloud Trace to correlate the information of the different Spring Boot microservice…
0
votes
1 answer

spring cloud gateway integrate spring cloud sleuth is 22% slower than using spring cloud gateway alone

When I use spring cloud gateway to integrate spring cloud sleuth, I find that the performance is much slower than using spring cloud gateway alone. Is there any optimization scheme? Machine configuration:6 core, 16g spring cloud gateway:5331.9…
0
votes
2 answers

Upgrade Spring Cloud Hoxton.SR6 to 2020.0.0

I am upgrading Spring Cloud version from Hoxton.SR6 to 2020.0.0 as part of Spring boot version upgrade from 2.3.4.RELEASE to 2.4.2. 2020.0.0
0
votes
0 answers

How to convert brave.propagation.TraceContext to JSON

Is there a way to convert the brave.propagation.TraceContext object to JSON? I tried new ObjectMapper().writeValueAsString(traceContextObject) but it gives {"localRoot":true}
Naresh Joshi
  • 4,188
  • 35
  • 45
0
votes
1 answer

Can I add tags to messaging spans based on message header values using Spring Cloud Sleuth?

I am using Spring Cloud Sleuth to send spans to zipkin when a Spring Boot application sends a message (to RabbitMQ). I would like to customize the information sent to zipkin to include some extra tags that are populated from certain headers of the…
wabrit
  • 217
  • 2
  • 14
0
votes
1 answer

Sleuth does not include ParentSpan in b3 single header for message to RabbitMQ

I've recently migrated from Spring Cloud Greenwich.SR2 to Hoxton.SR9, and am using Spring Sleuth to trace incoming REST calls to my Spring Boot app that trigger messages that ultimately arrive in RabbitMQ. Obviously one of the key differences in…
wabrit
  • 217
  • 2
  • 14
0
votes
2 answers

spring sleuth baggage propagation not working

I am using Sleuth first time need some help. I am currently using sleuth 2.2.3.RELEASE. My requirement is I want to propagate 2 fields product id and product type so that I can read these 2 values from other microservices for that I am using baggage…
Sandeep
  • 47
  • 1
  • 7