Skip to content

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

Closed
lidkowiak opened this issue Nov 7, 2015 · 3 comments
Closed

Comments

@lidkowiak
Copy link

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.

@philwebb philwebb added the for: team-attention An issue we'd like other members of the team to review label Nov 9, 2015
@wilkinsona wilkinsona added team-meeting and removed for: team-attention An issue we'd like other members of the team to review labels Nov 25, 2015
@philwebb philwebb added the type: enhancement A general enhancement label Jan 6, 2016
@philwebb philwebb added this to the 1.4.0 milestone Jan 6, 2016
@philwebb philwebb modified the milestones: 1.4.0.M2, 1.4.0 Jan 7, 2016
@philwebb philwebb modified the milestones: 1.4.0.M3, 1.4.0.M2 Apr 12, 2016
@philwebb philwebb modified the milestones: 1.4.0.M3, 1.4.0.RC1 May 17, 2016
@philwebb philwebb added the for: team-attention An issue we'd like other members of the team to review label May 25, 2016
@philwebb philwebb removed this from the 1.4.0.RC1 milestone May 25, 2016
@philwebb philwebb removed the for: team-attention An issue we'd like other members of the team to review label May 25, 2016
@golonzovsky
Copy link

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

Is this issue related/blocked by #4909 and/or #2949 ?

@golonzovsky
Copy link

golonzovsky commented Apr 6, 2017

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
are replaced with timers.

Resulting timers:

-- Timers ----------------------------------------------------------------------
timer.response.half
             count = 59
         mean rate = 1.12 calls/second
     1-minute rate = 1.62 calls/second
     5-minute rate = 2.36 calls/second
    15-minute rate = 2.52 calls/second
               min = 11.00 milliseconds
               max = 498.00 milliseconds
              mean = 214.34 milliseconds
            stddev = 137.68 milliseconds
            median = 225.00 milliseconds
              75% <= 299.00 milliseconds
              95% <= 438.00 milliseconds
              98% <= 463.00 milliseconds
              99% <= 498.00 milliseconds
            99.9% <= 498.00 milliseconds

@wilkinsona
Copy link
Member

This has been superseded by the planned move to Micrometer-based metrics (#9970)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants