'Sleuth doesn't show the trace id and the span id

I am trying to run a Spring Boot application and trace its execution with the support of Sleuth. The log shows the service name, but nothing for the trace id or the span id. All I get is [myservice,,,].

What am I missing?

Here are some lines from the log.

2017-04-30 14:41:38.750 INFO [myservice,,,] 7 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@5e57643e: startup date [Sun Apr 30 14:41:38 GMT 2017]; root of context hierarchy

2017-04-30 14:41:39.264 INFO [myservice,,,] 7 --- [ main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring

...

Thanks



Solution 1:[1]

Like Darren mentioned this is perfectly normal. What would you want to trace here? A trace is started by an rpc call or sth like that. Please read the docs where you can read about what distributed tracing is and you can watch my video where I explain how to use Sleuth

Solution 2:[2]

@Marcin Grzejszczak is right, traceId and spanId will show in the log line printed by logger.info("Hello Sleuth");

Solution 3:[3]

I have a WebFilter and I see traceId & spanId not are not present when receiving HTTP request. When exactly Spring Cloud Sleuth generates new traceId for incoming HTTP request context?

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Marcin Grzejszczak
Solution 2 Iceberg
Solution 3 Krzysztof Tomaszewski