1

Previously, in the application using Spring Boot 2.1.8, the traceId and spanId were successfully captured using the provided encoder format in logback.xml:

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
    <encoder>
        <pattern>%d{YYYY:MM:dd HH:mm:ss.SSSZ} 
            [%X{X-B3-TraceId:-},%X{X-B3-SpanId:-}]
            [${HOSTNAME}] [${PID:- }]
        </pattern>
    </encoder>
</appender>

The traceId and spanId were captured through Spring Cloud Sleuth observability metrics. However, I came across documentation during the Spring migration process indicating that there will be no Sleuth compatible version for Spring 6 and Spring Boot 3. The documentation can be found here: Migration to new 1.10.0 Observation API.

In Spring Boot 3, Micrometer serves as the tracing facade. Now, I am seeking guidance on how to capture the X-B3-TraceId and X-B3-SpanId with Micrometer in this updated environment.

Brian Clozel
  • 56,583
  • 15
  • 167
  • 176
Digital
  • 549
  • 1
  • 7
  • 26

0 Answers0