|
|
@ -33,6 +33,7 @@ import java.util.function.Supplier; |
|
|
|
|
|
|
|
|
|
|
|
import io.micrometer.observation.Observation; |
|
|
|
import io.micrometer.observation.Observation; |
|
|
|
import io.micrometer.observation.ObservationRegistry; |
|
|
|
import io.micrometer.observation.ObservationRegistry; |
|
|
|
|
|
|
|
import io.micrometer.observation.contextpropagation.ObservationThreadLocalAccessor; |
|
|
|
import org.reactivestreams.Publisher; |
|
|
|
import org.reactivestreams.Publisher; |
|
|
|
import reactor.core.publisher.Flux; |
|
|
|
import reactor.core.publisher.Flux; |
|
|
|
import reactor.core.publisher.Mono; |
|
|
|
import reactor.core.publisher.Mono; |
|
|
@ -75,11 +76,6 @@ class DefaultWebClient implements WebClient { |
|
|
|
|
|
|
|
|
|
|
|
private static final DefaultClientRequestObservationConvention DEFAULT_OBSERVATION_CONVENTION = new DefaultClientRequestObservationConvention(); |
|
|
|
private static final DefaultClientRequestObservationConvention DEFAULT_OBSERVATION_CONVENTION = new DefaultClientRequestObservationConvention(); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Aligned with ObservationThreadLocalAccessor#KEY from micrometer-core. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private static final String MICROMETER_OBSERVATION = "micrometer.observation"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final ExchangeFunction exchangeFunction; |
|
|
|
private final ExchangeFunction exchangeFunction; |
|
|
|
|
|
|
|
|
|
|
|
private final UriBuilderFactory uriBuilderFactory; |
|
|
|
private final UriBuilderFactory uriBuilderFactory; |
|
|
@ -463,7 +459,7 @@ class DefaultWebClient implements WebClient { |
|
|
|
DEFAULT_OBSERVATION_CONVENTION, () -> observationContext, observationRegistry); |
|
|
|
DEFAULT_OBSERVATION_CONVENTION, () -> observationContext, observationRegistry); |
|
|
|
observationContext.setCarrier(requestBuilder); |
|
|
|
observationContext.setCarrier(requestBuilder); |
|
|
|
observation |
|
|
|
observation |
|
|
|
.parentObservation(contextView.getOrDefault(MICROMETER_OBSERVATION, null)) |
|
|
|
.parentObservation(contextView.getOrDefault(ObservationThreadLocalAccessor.KEY, null)) |
|
|
|
.start(); |
|
|
|
.start(); |
|
|
|
ClientRequest request = requestBuilder.build(); |
|
|
|
ClientRequest request = requestBuilder.build(); |
|
|
|
observationContext.setUriTemplate((String) request.attribute(URI_TEMPLATE_ATTRIBUTE).orElse(null)); |
|
|
|
observationContext.setUriTemplate((String) request.attribute(URI_TEMPLATE_ATTRIBUTE).orElse(null)); |
|
|
|