1
votes

I use DropWizard to collect my own metrics for endpoints. I like my solution since I can add my own dimensions to it as I wish.

Apart from this Spring automatically collects and adds additional metric data to Dropwizard which I don't need. How to disable metrics in Spring-Boot to disable this?

I have found MetricsDropwizardAutoConfiguration.class, and DropwizardMetricServices.class but none seem to have a property or config to turn them off.

So my next thought was to turn off Spring-Boot-Actuator's metrics. I found these application.properties, while debugging, but these did not turn off the metric logging:

endpoints:
  metrics:
    enabled: false
management.endpoints.metrics.enabled: false
spring:
  metrics:
    export:
      enabled: false

EDIT

springBootVersion = '1.5.9.RELEASE'

2
what spring boot version you are using??kj007

2 Answers

1
votes

For 1.5.9 these should work:

endpoints.enabled=false # Enable endpoints.
endpoints.actuator.enabled=false # Enable the endpoint.

This should work in 2.x:

in application properties:

management.endpoint.metrics.enabled=false

in yaml:

management:
  endpoint:
    metrics:
      enabled: false
1
votes

My solution was to disable the auto-configuration: MetricsDropwizardAutoConfiguration.class using @SpringBootApplication(exclude = MetricsDropwizardAutoConfiguration.class}). This way I had to introduce my own MetricRegistry @Bean.