Sleuth 不显示跟踪 ID 和跨度 ID

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

我正在尝试 运行 Spring 引导应用程序并在 Sleuth 的支持下跟踪其执行。 日志显示服务名称,但没有显示跟踪 ID 或跨度 ID。我得到的只是 [myservice,].

我错过了什么?

这是日志中的一些行。

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

...

谢谢

就像 Darren 提到的那样,这是完全正常的。你想在这里追踪什么?跟踪是由 rpc 调用或类似的东西启动的。请阅读文档,您可以在其中了解什么是分布式跟踪,也可以观看我的视频,其中我解释了如何使用 Sleuth

@Marcin Grzejszczak 是对的,traceId 和 spanId 将显示在 logger.info("Hello Sleuth");

打印的日志行中

我有一个 Web 过滤器,但在接收 HTTP 请求时我发现 traceId 和 spanId 不存在。 Spring Cloud Sleuth 何时为传入的 HTTP 请求上下文生成新的 traceId?