Describe the bug I try to add a Micrometer-Capability in a FeignConfiguration, but it seems it is not taken into accout.

@FeignClient(name = "SomeClient", url = "xxx", configuration = FeignConfiguration.class)
public interface SomeService {

    @GET
    @Path("/some")
    Some getSome();
}
public class FeignConfiguration {

    @Bean
    public Contract contract() {
        return new JAXRSContract();
    }

    @Bean
    public Capability capability(MeterRegistry registry) {
        return new MicrometerCapability(registry);
    }
}

with

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-openfeign</artifactId>
            <version>2.2.5.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>io.github.openfeign</groupId>
            <artifactId>feign-micrometer</artifactId>
            <version>10.12</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>

The list of capabilitiesin Feign#builder() is empty in my case. It seems that In FeignClientFactoryBean#configureUsingConfiguration getInheritedAwareOptional(context, Capability.class) is missing to fetch the Capability and add it to the builder.

Is my analysis correct or am I just missing something?

Comment From: ryanjbaxter

See this SO answer, I think it shows how to do what you are asking.

https://stackoverflow.com/questions/65719975/use-micrometer-with-openfeign-in-spring-boot-application/65724088

@jonatan-ivanov @OlgaMaciaszek @spencergibb would it make some sense to perhaps have some autoconfiguration in OpenFeign to do this when feign-micrometer is on the classpath?

Comment From: spencergibb

I think so

Comment From: jonatan-ivanov

@ryanjbaxter I think so too, I wanted to create an issue and a draft PR for this. :) I'm late for the issue but I put together a draft PR to discuss about the feature: https://github.com/spring-cloud/spring-cloud-openfeign/pull/462

@ryanjbaxter @OlgaMaciaszek @spencergibb @shakuzen Could you please take a look?