Skip to content

Provide a mechanism to disable MetricFilterAutoConfiguration's metric filter #2599

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
paskos opened this issue Mar 4, 2015 · 9 comments
Closed
Labels
type: enhancement A general enhancement
Milestone

Comments

@paskos
Copy link

paskos commented Mar 4, 2015

Our project already uses Dropwizard com.codahale.metrics.servlet.InstrumentedFilter.
For us MetricFilterAutoConfiguration.MetricsFilter adds noise to our ops team with its added metrics.
We would like to remove it but we could not find a way.
One "easy" way would be for MetricFilterAutoConfiguration.MetricsFilter to be @ConditionalOnMissingBean(name="metricFilter")

@wilkinsona
Copy link
Member

If you don't want the metricFilter bean to be created you can disable the auto-configuration:

@SpringBootApplication(exclude=MetricFilterAutoConfiguration.class)

@paskos
Copy link
Author

paskos commented Mar 4, 2015

Unfortunately it's not possible.
Our Main class annotated with @SpringBootApplication is in a core project without dependency to spring-boot-actuator.jar.

@wilkinsona wilkinsona changed the title MetricFilterAutoConfiguration.MetricsFilter should be conditionalOnMissingBean("metricFilter") Provide a mechanism to disable MetricFilterAutoConfiguration's metric filter Mar 4, 2015
@wilkinsona
Copy link
Member

Making the bean @ConditionalOnProperty is more consistent with the rest of Spring Boot. See PersistenceExceptionTranslationAutoConfiguration, for example

@paskos
Copy link
Author

paskos commented Mar 4, 2015

I don't mind what type of @ConditionalOn as long as it is configurable

@snicoll snicoll added the type: enhancement A general enhancement label Mar 5, 2015
@snicoll snicoll added this to the 1.3.0 milestone Mar 5, 2015
@cemo
Copy link
Contributor

cemo commented Mar 16, 2015

I have opened two issue and both of them are resolving this issue. Please see #2661 and see #2660.

@philwebb philwebb modified the milestones: 1.3.0.M3, 1.3.0.RC1 Aug 5, 2015
@wilkinsona
Copy link
Member

This was fixed in d0cf6b5. endpoints.metrics.filter.enabled: false can now be used to turn the filter off. Alternatively, the whole auto-configuration can be excluded by class name thanks to a6f671b.

@paskos
Copy link
Author

paskos commented Aug 13, 2015

Thanks a lot guys !!!

@snicoll snicoll modified the milestones: 1.3.0.RC1, 1.3.0.M4 Aug 17, 2015
@khong07
Copy link

khong07 commented Dec 8, 2015

Hi,

I'm on spring boot 1.3.0.RELEASE but the property is endpoints.metrics.enabled and not endpoints.metrics.filter.enabled.

@wilkinsona
Copy link
Member

@khong07 Thanks for pointing this out. That shouldn't be the case. #4365 will reinstate endpoints.metrics.filter.enabled and allow the filter to be switched off independently.

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

No branches or pull requests

6 participants