2023-05-16 23:44:53 +02:00
|
|
|
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) {
|
2023-05-18 00:58:15 +02:00
|
|
|
if (id.getName().equals("http.requests")) {
|
2023-05-16 23:44:53 +02:00
|
|
|
return MeterFilterReply.NEUTRAL;
|
|
|
|
}
|
|
|
|
return MeterFilterReply.DENY;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|