Search in sources :

Example 1 with OnlyOnceLoggingDenyMeterFilter

use of org.springframework.boot.actuate.autoconfigure.metrics.OnlyOnceLoggingDenyMeterFilter in project spring-boot by spring-projects.

the class WebFluxMetricsAutoConfiguration method metricsHttpServerUriTagFilter.

@Bean
@Order(0)
public MeterFilter metricsHttpServerUriTagFilter() {
    String metricName = this.properties.getWeb().getServer().getRequest().getMetricName();
    MeterFilter filter = new OnlyOnceLoggingDenyMeterFilter(() -> String.format("Reached the maximum number of URI tags for '%s'.", metricName));
    return MeterFilter.maximumAllowableTags(metricName, "uri", this.properties.getWeb().getServer().getMaxUriTags(), filter);
}
Also used : MeterFilter(io.micrometer.core.instrument.config.MeterFilter) OnlyOnceLoggingDenyMeterFilter(org.springframework.boot.actuate.autoconfigure.metrics.OnlyOnceLoggingDenyMeterFilter) OnlyOnceLoggingDenyMeterFilter(org.springframework.boot.actuate.autoconfigure.metrics.OnlyOnceLoggingDenyMeterFilter) Order(org.springframework.core.annotation.Order) ConditionalOnBean(org.springframework.boot.autoconfigure.condition.ConditionalOnBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 2 with OnlyOnceLoggingDenyMeterFilter

use of org.springframework.boot.actuate.autoconfigure.metrics.OnlyOnceLoggingDenyMeterFilter in project spring-boot by spring-projects.

the class WebMvcMetricsAutoConfiguration method metricsHttpServerUriTagFilter.

@Bean
@Order(0)
public MeterFilter metricsHttpServerUriTagFilter() {
    String metricName = this.properties.getWeb().getServer().getRequest().getMetricName();
    MeterFilter filter = new OnlyOnceLoggingDenyMeterFilter(() -> String.format("Reached the maximum number of URI tags for '%s'.", metricName));
    return MeterFilter.maximumAllowableTags(metricName, "uri", this.properties.getWeb().getServer().getMaxUriTags(), filter);
}
Also used : MeterFilter(io.micrometer.core.instrument.config.MeterFilter) OnlyOnceLoggingDenyMeterFilter(org.springframework.boot.actuate.autoconfigure.metrics.OnlyOnceLoggingDenyMeterFilter) OnlyOnceLoggingDenyMeterFilter(org.springframework.boot.actuate.autoconfigure.metrics.OnlyOnceLoggingDenyMeterFilter) Order(org.springframework.core.annotation.Order) FilterRegistrationBean(org.springframework.boot.web.servlet.FilterRegistrationBean) ConditionalOnBean(org.springframework.boot.autoconfigure.condition.ConditionalOnBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 3 with OnlyOnceLoggingDenyMeterFilter

use of org.springframework.boot.actuate.autoconfigure.metrics.OnlyOnceLoggingDenyMeterFilter in project spring-boot by spring-projects.

the class HttpClientMetricsAutoConfiguration method metricsHttpClientUriTagFilter.

@Bean
@Order(0)
public MeterFilter metricsHttpClientUriTagFilter(MetricsProperties properties) {
    String metricName = properties.getWeb().getClient().getRequest().getMetricName();
    MeterFilter denyFilter = new OnlyOnceLoggingDenyMeterFilter(() -> String.format("Reached the maximum number of URI tags for '%s'. Are you using 'uriVariables'?", metricName));
    return MeterFilter.maximumAllowableTags(metricName, "uri", properties.getWeb().getClient().getMaxUriTags(), denyFilter);
}
Also used : MeterFilter(io.micrometer.core.instrument.config.MeterFilter) OnlyOnceLoggingDenyMeterFilter(org.springframework.boot.actuate.autoconfigure.metrics.OnlyOnceLoggingDenyMeterFilter) OnlyOnceLoggingDenyMeterFilter(org.springframework.boot.actuate.autoconfigure.metrics.OnlyOnceLoggingDenyMeterFilter) Order(org.springframework.core.annotation.Order) ConditionalOnBean(org.springframework.boot.autoconfigure.condition.ConditionalOnBean) Bean(org.springframework.context.annotation.Bean)

Example 4 with OnlyOnceLoggingDenyMeterFilter

use of org.springframework.boot.actuate.autoconfigure.metrics.OnlyOnceLoggingDenyMeterFilter in project cxf by apache.

the class MicrometerMetricsAutoConfiguration method cxfMetricsMaxAllowedServerUriTagsFilter.

@Bean
@Order(0)
public MeterFilter cxfMetricsMaxAllowedServerUriTagsFilter() {
    String metricName = this.properties.getMetrics().getServer().getRequestsMetricName();
    MeterFilter filter = new OnlyOnceLoggingDenyMeterFilter(() -> String.format("Reached the maximum number of URI tags for '%s'.", metricName));
    return MeterFilter.maximumAllowableTags(metricName, "uri", this.properties.getMetrics().getServer().getMaxUriTags(), filter);
}
Also used : MeterFilter(io.micrometer.core.instrument.config.MeterFilter) OnlyOnceLoggingDenyMeterFilter(org.springframework.boot.actuate.autoconfigure.metrics.OnlyOnceLoggingDenyMeterFilter) OnlyOnceLoggingDenyMeterFilter(org.springframework.boot.actuate.autoconfigure.metrics.OnlyOnceLoggingDenyMeterFilter) Order(org.springframework.core.annotation.Order) ConditionalOnBean(org.springframework.boot.autoconfigure.condition.ConditionalOnBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) JAXRSServerFactoryBean(org.apache.cxf.jaxrs.JAXRSServerFactoryBean) JaxWsServerFactoryBean(org.apache.cxf.jaxws.JaxWsServerFactoryBean) Bean(org.springframework.context.annotation.Bean)

Example 5 with OnlyOnceLoggingDenyMeterFilter

use of org.springframework.boot.actuate.autoconfigure.metrics.OnlyOnceLoggingDenyMeterFilter in project cxf by apache.

the class MicrometerMetricsAutoConfiguration method cxfMetricsMaxAllowedClientUriTagsFilter.

@Bean
@Order(0)
public MeterFilter cxfMetricsMaxAllowedClientUriTagsFilter() {
    String metricName = this.properties.getMetrics().getClient().getRequestsMetricName();
    MeterFilter filter = new OnlyOnceLoggingDenyMeterFilter(() -> String.format("Reached the maximum number of URI tags for '%s'.", metricName));
    return MeterFilter.maximumAllowableTags(metricName, "uri", this.properties.getMetrics().getClient().getMaxUriTags(), filter);
}
Also used : MeterFilter(io.micrometer.core.instrument.config.MeterFilter) OnlyOnceLoggingDenyMeterFilter(org.springframework.boot.actuate.autoconfigure.metrics.OnlyOnceLoggingDenyMeterFilter) OnlyOnceLoggingDenyMeterFilter(org.springframework.boot.actuate.autoconfigure.metrics.OnlyOnceLoggingDenyMeterFilter) Order(org.springframework.core.annotation.Order) ConditionalOnBean(org.springframework.boot.autoconfigure.condition.ConditionalOnBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) JAXRSServerFactoryBean(org.apache.cxf.jaxrs.JAXRSServerFactoryBean) JaxWsServerFactoryBean(org.apache.cxf.jaxws.JaxWsServerFactoryBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

MeterFilter (io.micrometer.core.instrument.config.MeterFilter)5 OnlyOnceLoggingDenyMeterFilter (org.springframework.boot.actuate.autoconfigure.metrics.OnlyOnceLoggingDenyMeterFilter)5 ConditionalOnBean (org.springframework.boot.autoconfigure.condition.ConditionalOnBean)5 Bean (org.springframework.context.annotation.Bean)5 Order (org.springframework.core.annotation.Order)5 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)4 JAXRSServerFactoryBean (org.apache.cxf.jaxrs.JAXRSServerFactoryBean)2 JaxWsServerFactoryBean (org.apache.cxf.jaxws.JaxWsServerFactoryBean)2 FilterRegistrationBean (org.springframework.boot.web.servlet.FilterRegistrationBean)1