I wanted to generate Prometheus metrics for Feign clients and saw that @jonatan-ivanov had merged support for this in https://github.com/spring-cloud/spring-cloud-openfeign/pull/462. After adding the feign-micrometer dependency in the classpath, I noticed feign metrics when hitting our metrics endpoint, but I'm confused on the meaning for some of them. Namely, what is the difference between metrics starting with feign_Feign vs feign_Client (examples: feign_Client_seconds_sum vs feign_Feign_seconds_sum)

I looked through https://docs.spring.io/spring-cloud-openfeign/docs/current/reference/html/ and found no references on the metrics and what they represent - there is also no helpful text when I generate the prometheus metrics.

Comment From: uqix

  • feign_Client means http client invocation, and feign_Feign means feign client invocation
  • when the circuit breaker is open, feign client invocation will not result in http client invocation

Comment From: jonatan-ivanov

@nakulm95 The Spring Cloud OpenFeign support just auto-configures feign-micrometer, if you want to know more about feign-micrometer, please check its docs/codebase.

In the name of these metrics, the second part is the name of the class that is instrumented: feign_<className> so I think @uqix comment should answer your question. Check FeignMetricName in feign-micrometer