Skip to content

Document issues when using Spring FactoryBean and Spring Cloud OpenFeign Clients #1009

Closed
@raul-avila-ph

Description

@raul-avila-ph

Bug description

We found a problem where Micrometer tracing propagation stops working when a Feign client is injected to a Spring FactoryBean.

Steps to reproduce:

  1. Have Micrometer tracing enabled
  2. Configure a Feign client
  3. Create a service class that contains the Feign client as dependency
  4. Instantiate the service class through a Spring FactoryBean, not using stereotype annotations or bean declaration. This FactoryBean will need to have a reference to the Feign client, because it will be necessary to instantiate the service class created in step 3

We would expect Micrometer traces to continue working. With the setup explained above it stopped working.

Sample

We have created a small sample project reproducing the issue, it can be found here: https://github.com/raul-avila-ph/tracing-issue/

The project contains a single test that passes only when tracing is working properly. The code in master has the test failing, while you can see there is a branch called without-factory-bean that basically removes the FactoryBean and instantiates the service with @Service. The test in this branch works, so tracing is not broken under these conditions.

Please note that this problem occurs when Feign client is a transitive dependency of the Spring FactoryBean as well, we have just injected it directly in the sample code for simplicity.

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions