0

I am using spring-cloud-starter-sleuth:1.3.2.RELEASE. For each request to the rest endpoint entires with two different traceId s are generated. Below is a sample log output for one complete request.

two traceIds: ce67bb66181b4368 & b228413a4cdd6eb8

{"timestamp":"2018-02-14T14:18:19.052+00:00","trace":"ce67bb66181b4368","span":"ce67bb66181b4368","parent":"","exportable":"false","pid":"12856"} {"timestamp":"2018-02-14T14:18:19.055+00:00","trace":"ce67bb66181b4368","span":"ce67bb66181b4368","parent":"","exportable":"false","pid":"12856"} {"timestamp":"2018-02-14T14:18:19.055+00:00","trace":"ce67bb66181b4368","span":"ce67bb66181b4368","parent":"","exportable":"false","pid":"12856"} {"timestamp":"2018-02-14T14:18:19.131+00:00","trace":"ce67bb66181b4368","span":"ce67bb66181b4368","parent":"ce67bb66181b4368","exportable":"false","pid":"12856","stack_trace":"o.s.w.c.HttpClientErrorException: 403 ..."} {"timestamp":"2018-02-14T14:18:19.147+00:00","trace":"ce67bb66181b4368","span":"ce67bb66181b4368","parent":"ce67bb66181b4368","exportable":"false","pid":"12856","stack_trace":"o.s.w.c.HttpClientErrorException: 403 ..."} {"timestamp":"2018-02-14T14:18:19.163+00:00","trace":"ce67bb66181b4368","span":"ce67bb66181b4368","parent":"ce67bb66181b4368","exportable":"false","pid":"12856","stack_trace":"o.s.w.c.HttpClientErrorException: 403 ..."} {"timestamp":"2018-02-14T14:18:19.178+00:00","trace":"","span":"","parent":"","exportable":"","pid":"12856","stack_trace":"o.s.w.c.HttpClientErrorException: 403 \r\n\tat o.s.w.c.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:85)\r\n\tat o.s.w.c.RestTemplate.handleResponse(RestTemplate.java:707)\r\n\t... 75 frames truncated\r\n"} {"timestamp":"2018-02-14T14:18:19.194+00:00","trace":"b228413a4cdd6eb8","span":"b228413a4cdd6eb8","parent":"","exportable":"false","pid":"12856"} {"timestamp":"2018-02-14T14:18:19.194+00:00","trace":"b228413a4cdd6eb8","span":"b228413a4cdd6eb8","parent":"","exportable":"false","pid":"12856"} {"timestamp":"2018-02-14T14:18:19.194+00:00","trace":"b228413a4cdd6eb8","span":"b228413a4cdd6eb8","parent":"","exportable":"false","pid":"12856"} {"timestamp":"2018-02-14T14:18:19.194+00:00","trace":"b228413a4cdd6eb8","span":"b228413a4cdd6eb8","parent":"","exportable":"false","pid":"12856"}

Flow: Rest client(postman) (calls)-> serviceA (calls)-> serviceB. ServiceB rejects the call with 403 and the same is propagated to the rest client - flow working as expected Issue is ServiceA is logging entries which have two different trace ids.

both serviceA and serviceB are spring boot apps.

Do not have any sample app. these are services I am working on. Doing nothing unusaual.

Added the dependency "spring-cloud-starter-sleuth:1.3.2.RELEASE" in the pom and updated logback-spring.xml config with encoder LoggingEventCompositeJsonEncoder.

Please advise. Thanks,

Thanks in Advance!

crs
  • 91
  • 1
  • 1
  • 6

0 Answers0