Propagate context in reactive HTTP server and client
Prior to this commit, the ServerHttpObservationFilter would not add
the current observation as a key in the Reactor context, preventing
from being used or propagated during the HTTP exchange handling.
Also, the client instrumentation in `DefaultWebClient` would start
the observation once the request is fully formed and immutable,
preventing the context from being propagated through HTTP request
headers.
This commit fixes both uses cases now by:
* adding the current observation as a key in the reactor context
on the server side
* using the `ClientRequest.Builder` as a Carrier on the client side
Closes gh-29388
pull/29167/head
Marcin Grzejszczak2 years agocommitted byBrian Clozel
@ -59,6 +59,11 @@ public class ServerHttpObservationFilter implements WebFilter {
@@ -59,6 +59,11 @@ public class ServerHttpObservationFilter implements WebFilter {
@ -117,7 +122,8 @@ public class ServerHttpObservationFilter implements WebFilter {
@@ -117,7 +122,8 @@ public class ServerHttpObservationFilter implements WebFilter {
@ -75,4 +78,18 @@ public class ClientRequestObservationContext extends RequestReplySenderContext<C
@@ -75,4 +78,18 @@ public class ClientRequestObservationContext extends RequestReplySenderContext<C
@ -79,7 +79,7 @@ public class DefaultClientRequestObservationConvention implements ClientRequestO
@@ -79,7 +79,7 @@ public class DefaultClientRequestObservationConvention implements ClientRequestO
@ -95,8 +95,8 @@ public class DefaultClientRequestObservationConvention implements ClientRequestO
@@ -95,8 +95,8 @@ public class DefaultClientRequestObservationConvention implements ClientRequestO
@ -143,15 +143,15 @@ public class DefaultClientRequestObservationConvention implements ClientRequestO
@@ -143,15 +143,15 @@ public class DefaultClientRequestObservationConvention implements ClientRequestO