Reputation: 2395
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'
Upvotes: 1
Views: 19482
Reputation: 1467
Setting following property should disable all the metrics -
management.metrics.enable.all=false
Based on
Upvotes: 0
Reputation: 2395
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.
Upvotes: 1
Reputation: 6254
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
Upvotes: 2