-
Notifications
You must be signed in to change notification settings - Fork 41.1k
Produce Dropwizard timer metrics instead of gauges in MetricsFilter #4405
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
Are there any plans to proceed on this? Maybe having Timer service in MetricsFilter (which could be enabled for dropwizard) would be a less duplicating approach. Seems there are some related requests #4196 Or the idea behind MetricsFilter is to limit recorded types only to ones which are displayed under /metrics endpoint? It might be least intrusive change to have some extension point under MetricsFilter#submitMetrics, so filter code could be reused for other cases. With current implementation without code change it seems that recording of timers can be done by wrapping gauge service |
In case someone will need this - managed to report gauges as timers with current implementation using following wrapper around DropwizardMetricServices: @Bean
DropwizardMetricServices dropwizardMetricServices(MetricRegistry metricRegistry,
ObjectProvider<ReservoirFactory> resFactoryProvider) {
return new DropwizardMetricServices(metricRegistry, resFactoryProvider.getIfAvailable()) {
@Override
public void submit(String name, double value) {
if (name.startsWith("response.")) {
super.submit("timer." + name, value);
} else {
super.submit(name, value);
}
}
};
} Its overriding autoconfigured DropwizardMetricServices. Response time gauges from MetricsFilter Resulting timers:
|
This has been superseded by the planned move to Micrometer-based metrics (#9970) |
Here spring-boot-dropwizard-metric-filter I implemented DropwizardMetricsFilter which produces timer metrics instead of only last response time. It is based on MetricsFilter and adds e.g. percentiles and rates metrics.
What do you think about merging it into Spring Boot Actuator? It could be enabled via AutoConfiguration when Dropwizard Metrics is on the classpath and/or with ConditionalOnProperty.
The text was updated successfully, but these errors were encountered: