Hi am using the below tracing framework in my spring boot project.
<dependency>
<groupId>io.opentracing.contrib</groupId>
<artifactId>opentracing-spring-jaeger-cloud-starter</artifactId>
<version>3.3.1</version>
</dependency>
I get the following exception when I start my application.
┌─────┐
| org.springframework.cloud.netflix.zuul.ZuulProxyAutoConfiguration (field private java.util.List org.springframework.cloud.netflix.zuul.ZuulServerAutoConfiguration.configurers)
↑ ↓
| io.opentracing.contrib.spring.web.starter.ServerTracingAutoConfiguration (field private java.util.regex.Pattern io.opentracing.contrib.spring.web.starter.ServerTracingAutoConfiguration.skipPattern)
↑ ↓
| skipPattern defined in class path resource [io/opentracing/contrib/spring/web/starter/SkipPatternAutoConfiguration.class]
↑ ↓
| org.springframework.cloud.client.CommonsClientAutoConfiguration$ActuatorConfiguration (field private java.util.List org.springframework.cloud.client.CommonsClientAutoConfiguration$ActuatorConfiguration.hasFeatures)
└─────┘
I can get rid of the error by placing the below attribute in my application.yml file. However, I do not know the impact of this flag.. Can someone throw some light on the consequence of this setting?
spring:
web:
ignoreAutoConfiguredSkipPatterns: true
The ignoreAutoConfiguredSkipPatterns property is responsible for building skipPattern value in TracingFilter. When ignoreAutoConfiguredSkipPatterns is false or not configured, skipPattern value will contain regular expression pattern to exclude certain paths from tracing (e.g. pattern is defined as /health|/status then URL http://localhost:5000/context/health won't be traced). If ignoreAutoConfiguredSkipPatterns is true, then skipPattern value will be null, then request will be traced in TracingFilter
P.S. As for me, issue is related with spring.cloud.features.enabled flag, that flag is enabled by default and as result hasFeatures field creates a circular dependency, please check code below:
@Configuration(proxyBeanMethods = false)
public class CommonsClientAutoConfiguration {
...
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(Endpoint.class)
@ConditionalOnProperty(value = "spring.cloud.features.enabled", matchIfMissing = true)
protected static class ActuatorConfiguration {
@Autowired(required = false)
private List<HasFeatures> hasFeatures = new ArrayList<>();
@Bean
@ConditionalOnAvailableEndpoint
public FeaturesEndpoint featuresEndpoint() {
return new FeaturesEndpoint(this.hasFeatures);
}
}
...
}