Current observation not in scope during WebClient ExchangeFilterFunction execution #33559
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
theme: observability
An issue related to observability and tracing
type: bug
A general bug
Milestone
This was discussed with @chemicL in micrometer-metrics/micrometer#5472
Currently,
DefaultWebClient
executesExchangeFilterFunction
as the reactive pipeline is assembled during subscription. This means that if imperative code is executed in a filter function, it won't be aware of the current observation through the local scope.For example, when automatic context propagation is enabled for Reactor operators, the logger MDC will not know about the current traceId/spanId.
We should defer the execution of filter functions to fix that limitation.
The text was updated successfully, but these errors were encountered: