-
Notifications
You must be signed in to change notification settings - Fork 784
Closed
Labels
Description
I want to read header values, and have them available on MDC. One single request works, but not when a test does many requests after each other.
Complete project that reproduces the error every time (on my computer, Java 17). Most often after only 6-7 iterations:
https://github.com/anderius/spring-sleuth-problem-demo
Excerpt from the sample:
@RestController
@SpringBootApplication
class DemoApplication {
@Bean
fun sleuthHttpServerRequestParser() = HttpRequestParser { request, context, _ ->
request.header("customHeader")
?.let { BaggageField.create("customField").updateValue(context, it) }
}
@Bean
fun spanHandler(): SpanHandler = SpanHandler.NOOP
@GetMapping("/mdc")
fun getMdc(): Map<String, String> = MDC.getCopyOfContextMap()
}
This issue might be related to #2064.