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
We are upgrading to Spring Boot 3.0 and Spring framework 6.0.2. We have observability activated in our services and are using DataDog and Prometheus.
When using the WebClient, we receive the following Exception:
java.lang.IllegalArgumentException: ClientRequest must not be null
at org.springframework.util.Assert.notNull(Assert.java:204)
Suppressed: The stacktrace has been enhanced by Reactor, refer to additional information below:
Original Stack Trace:
at app//org.springframework.util.Assert.notNull(Assert.java:204)
at app//org.springframework.web.reactive.function.client.DefaultClientRequestBuilder.<init>(DefaultClientRequestBuilder.java:72)
at app//org.springframework.web.reactive.function.client.ClientRequest.from(ClientRequest.java:134)
at app//org.springframework.boot.actuate.autoconfigure.observation.web.client.ClientObservationConventionAdapter.mutateClientRequest(ClientObservationConventionAdapter.java:66)
at app//org.springframework.boot.actuate.autoconfigure.observation.web.client.ClientObservationConventionAdapter.getLowCardinalityKeyValues(ClientObservationConventionAdapter.java:58)
at app//org.springframework.boot.actuate.autoconfigure.observation.web.client.ClientObservationConventionAdapter.getLowCardinalityKeyValues(ClientObservationConventionAdapter.java:36)
at app//io.micrometer.observation.SimpleObservation.start(SimpleObservation.java:134)
at app//org.springframework.web.reactive.function.client.DefaultWebClient$DefaultRequestBodyUriSpec.lambda$exchange$9(DefaultWebClient.java:465)
at app//reactor.core.publisher.MonoDeferContextual.subscribe(MonoDeferContextual.java:47)
at app//reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64)
at app//reactor.core.publisher.FluxRetryWhen.subscribe(FluxRetryWhen.java:77)
at app//reactor.core.publisher.MonoRetryWhen.subscribeOrReturn(MonoRetryWhen.java:46)
at app//reactor.core.publisher.Mono.subscribe(Mono.java:4429)
at app//reactor.core.publisher.Mono.block(Mono.java:1709)
It seems to be triggered by our custom tags that we set on the WebClient with our own Spring bean that extends from org.springframework.boot.actuate.metrics.web.servlet.DefaultWebMvcTagsProvider
bclozel
changed the title
WebClient call fails with java.lang.IllegalArgumentException: ClientRequest must not be null
WebClient instrumentation fails with IllegalArgumentException when adapting to WebClientExchangeTagsProvider
Dec 7, 2022
We are upgrading to Spring Boot 3.0 and Spring framework 6.0.2. We have observability activated in our services and are using DataDog and Prometheus.
When using the WebClient, we receive the following Exception:
It seems that WebClient starts an Observation:
https://github.com/spring-projects/spring-framework/blob/main/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClient.java#L465
This observation uses the ClientRequest in:
spring-boot/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/observation/web/client/ClientObservationConventionAdapter.java
Line 66 in 0acaa0e
But it is set afterwards in:
https://github.com/spring-projects/spring-framework/blob/main/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClient.java#L468
Causing this IllegalArgumentException.
The text was updated successfully, but these errors were encountered: