Add missing descriptions for HTTP Server and Data repositories metrics

See gh-31516
pull/32521/head
“Jakub 2 years ago committed by Stephane Nicoll
parent 0ef213a38d
commit ed7b333138

@ -83,8 +83,9 @@ public class MetricsRepositoryMethodInvocationListener implements RepositoryMeth
Set<Timed> annotations = TimedAnnotations.get(invocation.getMethod(), invocation.getRepositoryInterface());
Iterable<Tag> tags = this.tagsProvider.repositoryTags(invocation);
long duration = invocation.getDuration(TimeUnit.NANOSECONDS);
AutoTimer.apply(this.autoTimer, this.metricName, annotations, (builder) -> builder.tags(tags)
.register(this.registrySupplier.get()).record(duration, TimeUnit.NANOSECONDS));
AutoTimer.apply(this.autoTimer, this.metricName, annotations,
(builder) -> builder.description("Duration of repository invocations").tags(tags)
.register(this.registrySupplier.get()).record(duration, TimeUnit.NANOSECONDS));
}
}

@ -109,7 +109,8 @@ public class MetricsWebFilter implements WebFilter {
Iterable<Tag> tags = this.tagsProvider.httpRequestTags(exchange, cause);
long duration = System.nanoTime() - start;
AutoTimer.apply(this.autoTimer, this.metricName, annotations,
(builder) -> builder.tags(tags).register(this.registry).record(duration, TimeUnit.NANOSECONDS));
(builder) -> builder.description("Duration of HTTP server request handling").tags(tags)
.register(this.registry).record(duration, TimeUnit.NANOSECONDS));
}
catch (Exception ex) {
logger.warn("Failed to record timer metrics", ex);

@ -158,7 +158,8 @@ public class WebMvcMetricsFilter extends OncePerRequestFilter {
private Timer getTimer(Builder builder, Object handler, HttpServletRequest request, HttpServletResponse response,
Throwable exception) {
return builder.tags(this.tagsProvider.getTags(request, response, handler, exception)).register(this.registry);
return builder.description("Duration of HTTP server request handling")
.tags(this.tagsProvider.getTags(request, response, handler, exception)).register(this.registry);
}
/**

Loading…
Cancel
Save