Search code examples
spring-cloud-streamspring-cloud-sleuthspring-cloud-stream-binder-kafka

LEGACY_HEADER_MAPPING removed from spring-cloud-sleuth-instrumentation from Spring Cloud 2020.0.0 (aka Ilford) BWC issue


We moved to latest Spring Cloud 2020.0.0 (aka Ilford) in our project and when Brave Trace Ids (spanTraceId,spanId etc.. ) passing to Kafka Message it not get extracted by TracingChannelInterceptor because new Jar spring-cloud-sleuth-instrumentation removed the handling of LEGACY_HEADER_MAPPING from MessageHeaderPropagatorGetter.

Earlier we are using Spring-cloud-sleuth-core jar MessageHeaderPropagation.java to handle extract value of spanId,SpanTraceId etc...

old extract file of core 2.2.X

New extract file for slueth 3.X.

How to handle these legacy spanId, spanTraceId extraction in Spring Cloud 2020.0.0 (aka Ilford)?


Solution

  • You can't. That's a breaking change - we no longer support "X-B3_TraceId" in the headers. You need to use the new "traceId" approach