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 sleuth baggage - support in sleuth version #2

Is spring sleuth baggage going to be deprectaed? If yes what is the alternative? Is it must to have a configuration for the propogated field names starting version #2?
Dor
  • 3
  • 5
0
votes
1 answer

How to use spring cloud sleuth to propagate token

I need to know how the authorization is propagated using Spring sleuth and what all is need to implement for complete mechanism to propagate token received in Authorization Header. Thanks in advance for your valuable time.
0
votes
1 answer

Initial Traces created by Spring-Cloud-Gateway are all named "/", no matter the path

I've integrated sleuth into my application gateway and the services behind it. The traces in Stackdriver (GKE) look good but the root-span is always named "/". For example: The second span is also created by the gateway and has a much better…
0
votes
1 answer

Overwrite trace and span id

I have a spring application that accepts long-lived connections - each request starts a kafka consumer, which then writes consumed and processed messages to a requesting client. Each consumed kafka message contains sleuth tracing headers,…
Nav
  • 437
  • 1
  • 8
  • 16
0
votes
1 answer

Application start even if Kakfa is down

I have been working on spring cloud sleuth to push traces to zipkin, We are pushing traces to Kafka with the help of spring-cloud-starter-stream-kafka and spring-cloud-sleuth-stream Below are the dependencies I have added to my application compile…
PRATHAP S
  • 675
  • 2
  • 8
  • 26
0
votes
0 answers

Spring sleuth kafkaTemplate injections

Have a project with spring boot 2.1.9, spring kafka and spring sleuth (2.1.6). All's been going well till I reached the point of tracing messages to/from kafka. Kafka messaging is done through: kafkaTemplate.send(uri, pojo) And here I realized that…
Draaksward
  • 759
  • 7
  • 32
0
votes
1 answer

'spring.sleuth.integration.websockets.enable=false' doesn't disable tracing the websockets

I try to disable tracing WebSockets, so I put 'spring.sleuth.integration.websockets.enable=false' to my application.properties, but it seems it does nothing, WebSockets are still being…
HungryBird
  • 1,077
  • 1
  • 11
  • 28
0
votes
2 answers

Add trace and span id to Flink job

I've a requirement to add track and span id to Flink jobs running in cluster, the request flows something like below User --> Rest API -> Kafka-topic-1 --> FlinkJob-1 --> Kafka-topic-2 --> FlinkJob-2 --> Consumer --> DB I'm using Spring boot to…
0
votes
1 answer

Is it safe to clear the MDC context after every HTTP request with Spring Cloud Sleuth?

We clear the MDC context after every HTTP request in a org.springframework.web.filter.OncePerRequestFilter. We now want to use Spring Cloud Sleuth. Spring Cloud Sleuth also sets MDC values. Is it still OK to clear the whole MDC context after every…
Harold L. Brown
  • 8,423
  • 11
  • 57
  • 109
0
votes
3 answers

Zipkin Server giving Whitelabel Error Page

While creating a Zipkin Server with Spring Boot(v2), I am facing Whitelabel Error Page. " Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback. Wed Oct 30…
0
votes
1 answer

Sending SpringBoot / Sleuth Zipkin Traces to Honeycomb.io

Sending traces from an existing instrumented Spring Boot application to honeycomb-opentracing-proxy is failing with the following error in the proxy console: time="2019-10-25T02:51:55Z" level=info msg="error unmarshaling spans" error="json: cannot…
Patrick Bray
  • 552
  • 2
  • 7
  • 20
0
votes
1 answer

Exclude specific controllers from sleuth / brave to trace

we are using brave api in our spring boot application. We are able to trace all controllers and services. But issue is we are getting traces in some controllers which we do not want to trace like health check controller. Is there any way to specify…
viren
  • 1,073
  • 1
  • 17
  • 41
0
votes
2 answers

Adding Custom "trace id with Alpha numeric values and spiting it out in application Log "

I am using Sleuth 2.1.3. I want to add a custom "trace ID" as "correlation id" with alpha numeric value and want to spit in logs with spanid and parent id. If i use below implementation for creating new custom trace id. does it get …
0
votes
0 answers

Propagating extra fields/New fields distributed tracing solution for SpringCloud. configuring in BootClass

Added dependency for cloud sleuth and zipkin dependency of version below in pom.xml Pom.xml org.springframework.boot spring-boot
Raj
  • 93
  • 1
  • 10
0
votes
1 answer

Log the value of a Spring Cloud Sleuth Baggage in the current Span Context

I have a Spring Boot app (version 2.1.3.RELEASE) using Spring Cloud Sleuth and I would like to log the value of a baggage in the current Span Context. I am using Logback. My logger has this logback configuration: