@ -28,9 +28,12 @@ import feign.codec.Decoder;
@@ -28,9 +28,12 @@ import feign.codec.Decoder;
import feign.codec.Encoder ;
import feign.form.MultipartFormContentProcessor ;
import feign.form.spring.SpringFormEncoder ;
import feign.micrometer.FeignObservationConvention ;
import feign.micrometer.MicrometerCapability ;
import feign.micrometer.ObservedClientInterceptor ;
import feign.optionals.OptionalDecoder ;
import io.micrometer.core.instrument.MeterRegistry ;
import io.micrometer.observation.ObservationRegistry ;
import org.springframework.beans.factory.ObjectFactory ;
import org.springframework.beans.factory.ObjectProvider ;
@ -247,6 +250,14 @@ public class FeignClientsConfiguration {
@@ -247,6 +250,14 @@ public class FeignClientsConfiguration {
return new MicrometerCapability ( meterRegistry ) ;
}
@Bean
@ConditionalOnBean ( ObservationRegistry . class )
public FeignBuilderCustomizer defaultClientInterceptorProvider ( ObservationRegistry observationRegistry ,
ObjectProvider < FeignObservationConvention > feignObservationConvention ) {
return builder - > builder . clientInterceptor (
new ObservedClientInterceptor ( observationRegistry , feignObservationConvention . getIfAvailable ( ) ) ) ;
}
}
}