Open nickcodefresh opened 8 years ago
You should be able to solve it like this...
@Configuration
@ConditionalOnWebApplication
@Slf4j
public class GraphiteMetricsPublishingAutoConfiguration extends MetricsConfigurerAdapter {
@Configuration
@EnableMetrics
@ComponentScan(basePackages = {"com.ryantenney"})
public static class SpringMetricsConfiguration {
}
}
ComponentScan in your example is not necessary.
Didn't fixed :-( Caused by: java.io.FileNotFoundException: class path resource [com/ryantenney/metrics/spring/config/annotation/MetricsConfigurerAdapter.class] cannot be opened because it does not exist
I'm trying to create a spring boot autoconfiguration library that enables metrics publication by fault in my microservices. My auto config class is defined as
but it doesn't publish metrics unless I add @EnableMetrics to the application class of the application itself. The class is called though. Any ideas why?
Thanks
Nick