After migrating spring boot from version 2.x to 3 we miss traceId and spanId in our logs.
We removed all sleuth dependencies and added
implementation 'io.micrometer:micrometer-core'
implementation 'io.micrometer:micrometer-tracing'
implementation 'io.micrometer:micrometer-tracing-bridge-brave'
implementation platform('io.micrometer:micrometer-tracing-bom:latest.release')
as well as
logging.pattern.level: "%5p [${spring.application.name:},%X{traceId:-},%X{spanId:-}]"
but no traceIds and spanIds are being logged.
Is there something we missed?
You need actuator and a bridge, the rest you included is not needed:
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'io.micrometer:micrometer-tracing-bridge-brave'
If you also want to report your spans, you should add the zipkin reporter too:
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'io.micrometer:micrometer-tracing-bridge-brave'
implementation 'io.zipkin.reporter2:zipkin-reporter-brave'
Here's an example on start.spring.io and there are a lot of samples in the micrometer-samples repo.