question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Span informations missing when logging with DispatcherHandler starting from Sleuth 2.0.0.M8

See original GitHub issue

Hi,

Here are the versions I use :

  • Spring Framework version : 5.0.4.RELEASE
  • Spring Boot version : 2.0.1.RELEASE
  • Spring Cloud Sleuth : 2.0.0.RC1 (via Finchley.RC1 release train)

Using the latest version of spring cloud Sleuth, logging handled requests using o.s.web.reactive.DispatcherHandler (ie : Webflux equivalent to MVC o.s.web.servlet.DispatcherServlet) does not display span informations.

2018-05-04 15:06:06.109 DEBUG [myapp,,,] 73025 --- [ http-54] o.s.web.reactive.DispatcherHandler : Processing GET request for [http://localhost:8080/test]

If I switch back to Sleuth 2.0.0.M7 and Spring Boot 2.0.0.RELEASE, things are working as expected (the problem seems starting from Sleuth 2.0.0.M8 with both Spring Boot 2.0.1.RELEASE and 2.0.0.RELEASE) :

2018-05-04 15:09:12.449 DEBUG [myapp,394cf756c1f3a695,394cf756c1f3a695,false] 73218 --- [ http-52] o.s.web.reactive.DispatcherHandler : Processing GET request for [http://localhost:8080/test]

This strange behavior has impacts on log correlation. Does someone have any idea about this problem (is it spring boot or spring cloud sleuth ?) ?

Thank you.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
jhaeyaertcommented, May 4, 2018

Hi again,

You can find a simple spring boot project (I used spring initializr for convenience) here : https://github.com/jhaeyaert/issue-sleuth-logging

Follow these steps to reproduce the problem :

git clone https://github.com/jhaeyaert/issue-sleuth-logging
./mvnw clean package spring-boot:run

The server will start and if you make a curl on localhost:8080 you will have a 404 with expected working logs (ie : with span id). Ex:

2018-05-05 00:09:28.227 DEBUG [issue-sleuth-logging,283e076baa0d291b,283e076baa0d291b,false] 81648 --- [ctor-http-nio-2] o.s.web.reactive.DispatcherHandler       : Processing GET request for [http://localhost:8080/]
2018-05-05 00:09:28.314  WARN [issue-sleuth-logging,283e076baa0d291b,283e076baa0d291b,false] 81648 --- [ctor-http-nio-2] .a.w.r.e.DefaultErrorWebExceptionHandler : Failed to handle request [GET http://localhost:8080/]: Response status 404

Now if you update pom.xml and change <spring-cloud.version>Finchley.M8</spring-cloud.version> to <spring-cloud.version>Finchley.M9</spring-cloud.version> then restart the server you will now have DispatcherHandler log without span id. Ex :

2018-05-05 00:17:52.828 DEBUG [issue-sleuth-logging,,,] 81781 --- [ctor-http-nio-2] o.s.web.reactive.DispatcherHandler       : Processing GET request for [http://localhost:8080/]
2018-05-05 00:17:52.873  WARN [issue-sleuth-logging,72307898ff15112a,72307898ff15112a,false] 81781 --- [ctor-http-nio-2] .a.w.r.e.DefaultErrorWebExceptionHandler : Failed to handle request [GET http://localhost:8080/]: Response status 404

Note : I take a long time to make it work until I discover that whatever the version of Sleuth, If I remove the spring-boot-starter-actuator dependency then span id will never be logged by the DispatcherHandler. If the spring-boot-starter-actuator is added It works only with version <= Finchley.M8 (–> sleuth 2.0.0.M7)

I hope this will help you to figure out the problem.

0reactions
jhaeyaertcommented, May 16, 2018

Yes no problem I will test that tomorrow.

Read more comments on GitHub >

github_iconTop Results From Across the Web

OpenWRT 旁路由二次端口转发
So I would say that, yes, log4j 1.x is also impacted by this vulnerability https://github.com/apache/logging-log4j2/pull/608#issuecomment-990494126 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found