spring-cloud-openfeign icon indicating copy to clipboard operation
spring-cloud-openfeign copied to clipboard

Clarification between feign_Feign.* and feign_Client.* prometheus metrics

Open nakulm95 opened this issue 4 years ago • 2 comments

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.

nakulm95 avatar Apr 22 '22 23:04 nakulm95

  • 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

uqix avatar May 18 '22 06:05 uqix

@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

jonatan-ivanov avatar May 24 '22 17:05 jonatan-ivanov