I need to have a percentile histogram of my metrics (http.server.requests). I have checked the documentation but I cannot make it work.
I’m not using promotheus so the properties here (https://docs.spring.io/spring-boot/docs/2.0.5.RELEASE/reference/html/production-ready-metrics.html#_per_meter_properties) doesn’t work in my case.
I’ve tried to define a bean with implementing a DistributionStatisticConfig.
@Bean
public TimedAspect timedAspect(MeterRegistry registry) {
registry.config().meterFilter(
new MeterFilter() {
@Override
public DistributionStatisticConfig configure(Meter.Id id, DistributionStatisticConfig config) {
if (id.getName().startsWith("http.server.requests")) {
return DistributionStatisticConfig.builder()
.percentiles(0.5, 0.75, 0.9, 0.95)
.build()
.merge(config);
}
return config;
}
});
return new TimedAspect(registry);
}
I have a new metric that has been created with a new tag with the value of the percentile.
Any clue ?