mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2024-11-08 17:00:09 +01:00
28 lines
975 B
Java
28 lines
975 B
Java
|
package stirling.software.SPDF.config;
|
||
|
import org.springframework.context.annotation.Bean;
|
||
|
import org.springframework.context.annotation.Configuration;
|
||
|
import org.springframework.stereotype.Component;
|
||
|
import org.springframework.web.filter.OncePerRequestFilter;
|
||
|
|
||
|
import io.micrometer.core.instrument.Counter;
|
||
|
import io.micrometer.core.instrument.Meter;
|
||
|
import io.micrometer.core.instrument.MeterRegistry;
|
||
|
import io.micrometer.core.instrument.config.MeterFilter;
|
||
|
import io.micrometer.core.instrument.config.MeterFilterReply;
|
||
|
|
||
|
@Configuration
|
||
|
public class MetricsConfig {
|
||
|
|
||
|
@Bean
|
||
|
public MeterFilter meterFilter() {
|
||
|
return new MeterFilter() {
|
||
|
@Override
|
||
|
public MeterFilterReply accept(Meter.Id id) {
|
||
|
if (id.getName().equals("http.requests") || id.getName().equals("health")) {
|
||
|
return MeterFilterReply.NEUTRAL;
|
||
|
}
|
||
|
return MeterFilterReply.DENY;
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
}
|