spring-cloud-sleuth icon indicating copy to clipboard operation
spring-cloud-sleuth copied to clipboard

Trace are not being injected in netty error logs

Open Jojoooo1 opened this issue 2 years ago • 2 comments

When an error in thrown the trace are not being injected in netty error logs.

Screenshot from 2022-07-25 15-04-11

Expected Behavior

Traces should be injected in error logs.

Actual Behavior

Traces are not being injected.

Your Environment

java: 17 spring-boot: 2.7.2 spring-boot-starter-webflux using reactor netty http 1.0.21 spring-cloud-starter-sleuth: 3.1.3

Jojoooo1 avatar Jul 25 '22 16:07 Jojoooo1

I see the same behaviour if using DECORATE_QUEUES, but using DECORATE_ON_EACH as the Reactor Instrumentation type preserved the trace id.

samueldlightfoot avatar Aug 09 '22 11:08 samueldlightfoot

@samueldlightfoot DECORATE_QUEUES seems to not pass the traces when using flatMap DECORATE_ON_EACH will. But it seems in any case that the trace are not passed to the error log of the webClient which make it very complicate to hunt down the error afterward.

Jojoooo1 avatar Aug 09 '22 11:08 Jojoooo1

I would suggest using DECORATE_ON_EACH. Of course it means a big performance drop but it should work most of the time. Sleuth and Reactor instrumentation works most of the time - most likely you found a problematic spot where it doesn't work well. Have you tried the latest snapshots of sleuth?

marcingrzejszczak avatar Aug 17 '22 13:08 marcingrzejszczak

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

spring-cloud-issues avatar Aug 24 '22 13:08 spring-cloud-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

spring-cloud-issues avatar Aug 31 '22 13:08 spring-cloud-issues