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

Spring Cassandra driver always connected to localhost

im trying to connect my Spring Boot app to a Cassandra 2.2.8 cluster on EC2 instances (2 nodes). my use is tracing with Sleuth and Zipkin. when the tracing start, the driver always point to localhost : com.datastax.driver.core.Cluster : New…
redoff
  • 1,124
  • 11
  • 18
0
votes
1 answer

Can Spring Cloud Sleuth trace HTTP calls made through Async RestTemplate

I am trying to trace HTTP calls made through Async RestTemplate from a Spring Boot Application. I have a ZipKin instance running locally to which the microservices in question point to. I could see spans recorded at every service in ZipKin UI,…
0
votes
1 answer

Spring Boot Micro Service Tracing Options

I am having below requirement for which is there any open source library will cover all of them. 1.We are building a distributed micro service architecture with Spring Boot.Which includes more than 100 micro services. 2.There is a lot if inter micro…
springbootlearner
  • 1,220
  • 4
  • 26
  • 48
0
votes
1 answer

Spring MVC HandlerInterceptorAdapter Missing slf4j Logback Trace ID

I have Spring MVC Application where I have implemented a class which extends HandlerInterceptorAdapter for me to perform some operations inside preHandle, postHandle and afterCompletion before any controller gets executed. below is what I am…
Imran
  • 5,542
  • 3
  • 23
  • 46
0
votes
1 answer

How to Customize the Zipkin message publisher?

I have created a spring-boot application which publishes zipkin logs to a zipkin consumer. But the Zipkin consumer(another spring boot application) is behind some authentication filters which check for several parameters/headers in the request…
falcon
  • 1,332
  • 20
  • 39
0
votes
1 answer

spring cloud sleuth and Oauth2Template

We are using microservices with oauth2 as security mechanism. At the moment we are calling other microservices with OAuth2RestTemplate like this: template.postForObject("http://"+MY_DISCOVERY_NAME+"/path/to/restservice", params, Void.class); We…
Max
  • 475
  • 1
  • 10
  • 19
0
votes
0 answers

Is consul based discovery supported for spring cloud sleuth?

I have been moving my eureka based micro services system to consul and I have most of the key features working, discovery, config management, and metadata tags as per the original application. But I am having exception show up when I am using…
EvilJinious1
  • 2,773
  • 6
  • 43
  • 63
0
votes
0 answers

Sleuth and java-based logstash appender failing to parse log pattern

I have added sleuth/zipkin into my project. I'm using logback, and by default I get very well formatted logs in my console and files as well. I'm also using a logstash appender, and when I look at how kibana presents those logs - I'm not satisfied…
bart.s
  • 688
  • 5
  • 12
0
votes
1 answer

spring-cloud-sleuth one of the microserives out of three does not show the spanid, and token id in logs after adding dependency

I am using http://cloud.spring.io/spring-cloud-sleuth/spring-cloud-sleuth.html#_adding_to_the_project for adding Spring Cloud Sleuth without the Zipkin integration But in one of the microserives out of three, does not show the spanid, and token id…
lowLatency
  • 5,534
  • 12
  • 44
  • 70
0
votes
1 answer

Spring Cloud Sleuth + Zipking - How to trace individual instances

I am using Spring Cloud Sleuth + Zipkin to have an insight of the service timing and behaviour. The only downside I have found is: when there are several instances of every microservice I haven't found a way to determine which instance Zipkin…
codependent
  • 23,193
  • 31
  • 166
  • 308
-1
votes
1 answer

How to specify which paths should be traced by Sleuth with Zipkin?

I'm looking for some information about how to specify which endpoints should be traced by Sleuth. By far, all i've found in sleuth docs was information about how to specify which endpoints shouldn't be traced. I'm going in the opposite direction,…
-1
votes
1 answer

Is it possible to tell spring cloud sleuth to not log values like passwords?

So I enabled Spring Cloud Sleuth in my spring boot app and this happened: 2021-03-03 19:11:11.164 DEBUG [OAuth2 service,b1e3783b06d8cc61,b1e3783b06d8cc61] 5056 --- [nio-8080-exec-5] o.s.web.client.RestTemplate : Writing…
stacktrace2234
  • 1,172
  • 1
  • 12
  • 22
-1
votes
1 answer

How to Configure JMS Listener with logging Sleuth Trace ID in SQS Communication

I am using spring JMS to send and recieve message to AWS SQS. Below is my JMS configuration class. I am using spring sleuth to log trace id. What i want to achive is the trace id when logged should be same in producer class and in consumer…
VIJ
  • 1,516
  • 1
  • 18
  • 34
-1
votes
1 answer

How to retrieve spanid using java in Sleuth version 2.0.4

I need to know the SpandId in java code but I don't know how to get it. I had been searching and I found that many people refer to Tracer class, but it is not available at sleuth 2.0.4. Does anybody know how to get the SpandId using sleuth…
-1
votes
1 answer

Tracing of spring boot microservice application

what are the best practices in tracing of spring boot 2 microservice applications? I found some 2 years old tutorials where tracing server was as another spring boot application with following dependencies:
1 2 3
42
43