You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ensure that client responses are observed when filters fail
Prior to this commit, an error thrown by a `ExchangeFilterFunction`
configured on a `WebClient` instance would be recorded as such by the
client observation, but the response details would be missing from the
observation.
All filter functions and the exchange function (performing the HTTP
call) would be merged into a single `ExchangeFunction`; this instance
was instrumented and osberved. As a result, the instrumentation would
only get the error signal returned by the filter function and would not
see the HTTP response even if it was received. This means that the
recorded observation would not have the relevant information for the
HTTP status.
This commit ensures that between the configured `ExchangeFilterFunction`
and the `ExchangeFunction`, an instrumentation `ExchangeFilterFunction`
is inserted. This allows to set the client response to the observation
context, even if a later error signal is thrown by a filter function.
Note that with this change, an error signal sent by a filter function
will be still recorded in the observation.
See gh-30059
Copy file name to clipboardExpand all lines: spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClientBuilder.java
Copy file name to clipboardExpand all lines: spring-webflux/src/test/java/org/springframework/web/reactive/function/client/WebClientObservationTests.java
+13
Original file line number
Diff line number
Diff line change
@@ -133,6 +133,19 @@ public Mono<ClientResponse> filter(ClientRequest request, ExchangeFunction chain
0 commit comments