You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My project is based on spring-cloud-stream-kafka 3.1.4 and spring-cloud-sleuth 3.0.4 (and zipkin brave).
When I use Sleuth, while also benefiting from tracing context information from slf4j.MDC such as traceId and spanId, it allows me to track logs more easily.
However, I recently found out that when Sleuth collects information about kafka-streams endpoints, it does not update MDC.
This is because Brave only updates MDC when a span is in scope(brave.context.slf4j.MDCScopeDecorator.MDCContext), and Sleuth does not have corresponding support for spring cloud stream kafka; it directly uses the kafka-streams instrument provided by Brave.
As far as I know, none of the instruments provided by Brave simultaneously enable scope when create/get span.
On the other hand, the web instruments (such as org.springframework.cloud.sleuth.instrument.web.servlet.TracingFilter) provided by Sleuth have scope enabled during processing.
Q:
Is it true that Sleuth does not enable Scope when processing Kafka Streams?
(If the answer to 1 is True) Why is Scope not enabled when processing kafka-streams endpoints, but it is enabled when handling Web requests?
Is opening the scope myself a good practice? (through AOP or other means)
The text was updated successfully, but these errors were encountered:
I think this is intentional since you can get multiple messages at that point, which one of them should be chosen for propagating its tracing information?
Also, even if this would be a bug, Sleuth 3.1 reached the end of its OSS support lifetime, you should migrate to the latest Micrometer Tracing (and latest Spring Boot 3.x).
Hi team,
My project is based on
spring-cloud-stream-kafka 3.1.4
andspring-cloud-sleuth 3.0.4
(andzipkin brave
).When I use Sleuth, while also benefiting from tracing context information from
slf4j.MDC
such astraceId
andspanId
, it allows me to track logs more easily.However, I recently found out that when Sleuth collects information about kafka-streams endpoints, it does not update MDC.
This is because Brave only updates MDC when a span is in scope(
brave.context.slf4j.MDCScopeDecorator.MDCContext
), and Sleuth does not have corresponding support for spring cloud stream kafka; it directly uses the kafka-streams instrument provided by Brave.As far as I know, none of the instruments provided by Brave simultaneously enable scope when create/get span.
On the other hand, the web instruments (such as
org.springframework.cloud.sleuth.instrument.web.servlet.TracingFilter
) provided by Sleuth have scope enabled during processing.Q:
The text was updated successfully, but these errors were encountered: