MDCInstrumenter does not propagate context from one thread pool to another after moving to micronaut 2.0.0 #3950
Replies: 15 comments
-
@graemerocher - As discussed, created a new issue. |
Beta Was this translation helpful? Give feedback.
-
Could this be related to #3868 ? |
Beta Was this translation helpful? Give feedback.
-
quite possibly |
Beta Was this translation helpful? Give feedback.
-
I think you are missing tracing implementation, you should see tracing headers in the response. Can you try to add Brave? |
Beta Was this translation helpful? Give feedback.
-
@dstepanov, If you can see the sample project I tagged to this issue, I added micronaut-tracing dependency. |
Beta Was this translation helpful? Give feedback.
-
@mutyasaisrikar Check this page https://guides.micronaut.io/micronaut-microservices-distributed-tracing-zipkin/guide/index.html you can see added Brave dependencies to the runtime. |
Beta Was this translation helpful? Give feedback.
-
@dstepanov, I have seen the example you mentioned. We are not trying to integrate with Zipkin. I also tried adding only 'io.opentracing.brave:brave-opentracing' which is not giving what I wanted, to propagate MDC |
Beta Was this translation helpful? Give feedback.
-
@dstepanov @graemerocher , any more ideas on this please? |
Beta Was this translation helpful? Give feedback.
-
not at this stage, on the list to investigate |
Beta Was this translation helpful? Give feedback.
-
@mutyasaisrikar Can you provide a project with the version where it did work? I can check what's different. |
Beta Was this translation helpful? Give feedback.
-
@dstepanov, please check this https://github.com/mutyasaisrikar/micronaut-mdc-issue-1.x |
Beta Was this translation helpful? Give feedback.
-
@mutyasaisrikar Looks like your V2 example is using logbook if you copy the logger from V1 it's logging the same. |
Beta Was this translation helpful? Give feedback.
-
@dstepanov, we wanted to use ChannelPipelineCustomizer which is as part of Micronaut 2.x netty. I would expect that it will be same as V1 filter, right? |
Beta Was this translation helpful? Give feedback.
-
@mutyasaisrikar Netty works outside Micranaut, you can set You can try to integrate Brave, it looks like has support for Netty https://github.com/openzipkin/brave/tree/master/instrumentation/netty-codec-http but you might need to do more work to propagate custom correlation id. |
Beta Was this translation helpful? Give feedback.
-
Converted this to a discussion since unclear whether there is actually a bug here |
Beta Was this translation helpful? Give feedback.
-
With the io.micronaut:micronaut-tracing dependency added to my project I was hoping the MDC context would be propagated across my the whole request.
It stopped working when we moved to Micronaut 2.0.0
Sample project where I can see the issue..
https://github.com/mutyasaisrikar/micronaut-mdc-issue
When you run the test case, you can see the below logs,
`[pool-2-thread-1] 5841aea8-df8a-4ea6-ac41-ee8d4a6e3d95 INFO c.s.test.interfaces.MyController - Request came at 1598018384988
[pool-2-thread-1] 5841aea8-df8a-4ea6-ac41-ee8d4a6e3d95 INFO c.s.test.interfaces.MyController - Making a dummy call
[qtp837249677-33] INFO / - RequestHandlerClass from context returned com.github.tomakehurst.wiremock.http.StubRequestHandler. Normalized mapped under returned 'null'
[nioEventLoopGroup-1-3] INFO httpclient - Request: endpoint http://localhost:60106/test, method GET
[pool-2-thread-1] 5841aea8-df8a-4ea6-ac41-ee8d4a6e3d95 INFO c.s.test.interfaces.MyController - Request completed at 1598018385309
`
The correlation we are storing in MDC is not getting populated for httpclient log
Beta Was this translation helpful? Give feedback.
All reactions