traceId and spanId is not printing in the logs for Spring boot 3.2.x distributed tracing

55 Views Asked by At

I have implemented distributed tracing in my spring cloud microservices using micrometer and opentelemetry

    implementation 'io.micrometer:micrometer-tracing-bridge-otel'
    implementation 'io.opentelemetry:opentelemetry-exporter-zipkin'

everything is working fine logs are exporting to zipkin server and I can see the traceid and spanid in zipkin ui, but in logs traceid and spanid are not printing I have tried below solutions

added logging pattern level logging.pattern.level: "%5p [${spring.application.name:},%X{traceId:-},%X{spanId:-}]"

I'm using both web and webflux so for webflux projects I have added Hooks.enableAutomaticContextPropagation();

still in logs it's not printing INFO [gateway,,] 8 --- [gateway] [ main], can anyone help me to fix this?

0

There are 0 best solutions below