Skip to content

Commit 8e3aaf1

Browse files
committed
Merge branch '2.7.x'
Closes gh-31707
2 parents 9cace34 + 3e4a570 commit 8e3aaf1

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/data/MetricsRepositoryMethodInvocationListener.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@ public void afterInvocation(RepositoryMethodInvocation invocation) {
6868
Set<Timed> annotations = TimedAnnotations.get(invocation.getMethod(), invocation.getRepositoryInterface());
6969
Iterable<Tag> tags = this.tagsProvider.repositoryTags(invocation);
7070
long duration = invocation.getDuration(TimeUnit.NANOSECONDS);
71-
AutoTimer.apply(this.autoTimer, this.metricName, annotations, (builder) -> builder.tags(tags)
72-
.register(this.registrySupplier.get()).record(duration, TimeUnit.NANOSECONDS));
71+
AutoTimer.apply(this.autoTimer, this.metricName, annotations,
72+
(builder) -> builder.description("Duration of repository invocations").tags(tags)
73+
.register(this.registrySupplier.get()).record(duration, TimeUnit.NANOSECONDS));
7374
}
7475

7576
}

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/server/MetricsWebFilter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ private void record(ServerWebExchange exchange, Throwable cause, long start) {
109109
Iterable<Tag> tags = this.tagsProvider.httpRequestTags(exchange, cause);
110110
long duration = System.nanoTime() - start;
111111
AutoTimer.apply(this.autoTimer, this.metricName, annotations,
112-
(builder) -> builder.tags(tags).register(this.registry).record(duration, TimeUnit.NANOSECONDS));
112+
(builder) -> builder.description("Duration of HTTP server request handling").tags(tags)
113+
.register(this.registry).record(duration, TimeUnit.NANOSECONDS));
113114
}
114115
catch (Exception ex) {
115116
logger.warn("Failed to record timer metrics", ex);

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ private Set<Timed> getTimedAnnotations(Object handler) {
155155

156156
private Timer.Builder getTimer(Builder builder, Object handler, HttpServletRequest request,
157157
HttpServletResponse response, Throwable exception) {
158-
return builder.tags(this.tagsProvider.getTags(request, response, handler, exception));
158+
return builder.description("Duration of HTTP server request handling")
159+
.tags(this.tagsProvider.getTags(request, response, handler, exception));
159160
}
160161

161162
/**

0 commit comments

Comments
 (0)