Closed oleborne closed 1 year ago
hi @oleborne! can you post your reproducer to github? that make it a lot easier for us to take a quick look and make sure we're investigating the right thing
Here you are: https://github.com/oleborne/java-instrumentation-issue7344
Thanks for your attention
When using the JavaAgent,
ContextStorageWrappersInstrumentation
adds a wrapper as the very last one. The purpose of this wrapper is the following:By being the last wrapper and fully replacing the
ContextStorage
, this defeats the purpose of the wrapper: not replace theContextStorage
but "enrich" it. All wrappers that were previously installed on theContextStorage
are ignored.Notably, Spring Boot 3 installs a wrapper on the
ContextStorage
for the purpose of reacting to scope changes and update trace and span id in slf4j MDC.Steps to reproduce
logging.pattern.level=%5p [%X{traceId:-},%X{spanId:-}]
What did you expect to see? I would expect to see the trace and span id in the logs.
What did you see instead? Trace and span are not in the logs since the
AgentContextStorage
replaced theContextStorage
that was wrapped by Spring Boot.What version are you using? v1.20.1
Environment Compiler: Coretto 17.0.4.1 OS: macOS 12.6.1