我正在使用spring-cloud-starter-sleuth:1.3.2.RELEASE。对于每个对其余端点的请求,将生成两个不同的traceId。下面是一个完整请求的示例日志输出。
两个traceIds:ce67bb66181b4368& b228413a4cdd6eb8
{"时间戳":" 2018-02-14T14:18:19.052 + 00:00""跟踪":" ce67bb66181b4368&#34 ;,"跨度":" ce67bb66181b4368""父":"""导出":&#34假#34;" PID":" 12856"} {"时间戳":" 2018-02-14T14:18:19.055 + 00:00""跟踪":" ce67bb66181b4368",& #34;跨度":" ce67bb66181b4368""父":"""导出":"假&# 34;," PID":" 12856"} {"时间戳":" 2018-02-14T14:18:19.055 + 00:00""跟踪":" ce67bb66181b4368",& #34;跨度":" ce67bb66181b4368""父":"""导出":"假&# 34;," PID":" 12856"} {"时间戳":" 2018-02-14T14:18:19.131 + 00:00""跟踪":" ce67bb66181b4368",& #34;跨度":" ce67bb66181b4368""父":" ce67bb66181b4368""导出":"假&# 34;," pid":" 12856"," stack_trace":" oswcHttpClientErrorException:403 ..."} {"时间戳":" 2018-02-14T14:18:19.147 + 00:00""跟踪":" ce67bb66181b4368",& #34;跨度":" ce67bb66181b4368""父":" ce67bb66181b4368""导出":"假&# 34;," pid":" 12856"," stack_trace":" oswcHttpClientErrorException:403 ..."} {"时间戳":" 2018-02-14T14:18:19.163 + 00:00""跟踪":" ce67bb66181b4368",& #34;跨度":" ce67bb66181b4368""父":" ce67bb66181b4368""导出":"假&# 34;," pid":" 12856"," stack_trace":" oswcHttpClientErrorException:403 ..."} {"时间戳":" 2018-02-14T14:18:19.178 + 00:00""跟踪":"",& #34;跨度":"""父":"""导出":"&# 34;," pid":" 12856"," stack_trace":" oswcHttpClientErrorException:403 \ r \ n \ tat oswcDefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler .java:85)\ r \ n \ tat oswcRestTemplate.handleResponse(RestTemplate.java:707)\ r \ n \ t ... 75帧截断\ r \ n"} {"时间戳":" 2018-02-14T14:18:19.194 + 00:00""跟踪":" b228413a4cdd6eb8",& #34;跨度":" b228413a4cdd6eb8""父":"""导出":"假&# 34;," PID":" 12856"} {"时间戳":" 2018-02-14T14:18:19.194 + 00:00""跟踪":" b228413a4cdd6eb8",& #34;跨度":" b228413a4cdd6eb8""父":"""导出":"假&# 34;," PID":" 12856"} {"时间戳":" 2018-02-14T14:18:19.194 + 00:00""跟踪":" b228413a4cdd6eb8",& #34;跨度":" b228413a4cdd6eb8""父":"""导出":"假&# 34;," PID":" 12856"} {"时间戳":" 2018-02-14T14:18:19.194 + 00:00""跟踪":" b228413a4cdd6eb8",& #34;跨度":" b228413a4cdd6eb8""父":"""导出":"假&# 34;," PID":" 12856"}
流速: 休息客户(邮递员)(电话) - > serviceA(电话) - > serviceB。 ServiceB拒绝403的调用,并将其传播到其余客户端 - 流程按预期工作 问题是ServiceA正在记录具有两个不同跟踪ID的条目。
serviceA和serviceB都是spring boot apps。
没有任何示例应用。这些是我正在努力的服务。无所事事。
添加了依赖关系" spring-cloud-starter-sleuth:1.3.2.RELEASE"在pom中并使用编码器LoggingEventCompositeJsonEncoder更新了logback-spring.xml配置。
请指教。谢谢,
提前致谢!