-
Notifications
You must be signed in to change notification settings - Fork 41.1k
Statsd server gets no metric report when using spring boot metrics API and Dropwizard implementation #8254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think the reason is that MetricsDropwizardAutoConfiguration doesn't have any Bean defined as @ExportMetricReader, but overrides the bean definition in MetricRepositoryAutoConfiguration . @Configuration
public class MetricConfig {
@Bean
@ExportMetricReader
public MetricReader metricReader(MetricRegistry metricRegistry) {
return new MetricRegistryMetricReader(metricRegistry);
}
} |
When you add Dropwizard to the classpath, I believe the assumption is that you want metrics to be sent into Dropwizard. This is done automatically by What was your goal when you added the |
@wilkinsona Through debug, I can see the CounterService instance is type of I guess the reason is Is it supposed to define MetricRegistryMetricReader as MetricReader automatically ( in |
It should be noted that it can also come from transitive dependencies (such as via |
I tried to exclude that transitive dependency from spring-starter-data-cassandra because my project uses it. Unfortunately the cassandra driver then complains about not having it. I solved the issue for now by excluding the MetricsDropwizardAutoConfiguration in application.yml, like this:
|
This has been superseded by the planned move to Micrometer-based metrics (#9970) |
I'm doing it as below:
The result is statsd server won't get any report when using spring boot metrics API and Dropwizard implementation.
If I remove Dropwizard metric dependency, just use default implementation then it works.
Do I miss anything or is it a bug?
The text was updated successfully, but these errors were encountered: