From 7a636e5c0812ac53bccf053b2d786e97482cd303 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Thu, 8 Apr 2021 23:15:44 -0700 Subject: [PATCH] Update @Timed WebFlux documentation Closes gh-23112 --- .../src/docs/asciidoc/production-ready-features.adoc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/production-ready-features.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/production-ready-features.adoc index 4b7220ee36..b45cceba1b 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/production-ready-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/production-ready-features.adoc @@ -2161,9 +2161,9 @@ Alternatively, when set to `false`, you can enable instrumentation by adding `@T } ---- -<1> A controller class to enable timings on every request handler in the controller. +<1> A controller class to enable timings on every request handler in the controller not directly annotated with `@Timed`. <2> A method to enable for an individual endpoint. - This is not necessary if you have it on the class, but can be used to further customize the timer for this particular endpoint. + This is not necessary if you have it on the class, but can be used to customize the timer for this particular endpoint. <3> A method with `longTask = true` to enable a long task timer for the method. Long task timers require a separate metric name, and can be stacked with a short task timer. @@ -2199,9 +2199,12 @@ TIP: In some cases, exceptions handled in Web controllers are not recorded as re Applications can opt-in and record exceptions by <>. + [[production-ready-metrics-web-flux]] ==== Spring WebFlux Metrics Auto-configuration enables the instrumentation of all requests handled by WebFlux controllers and functional handlers. +When `management.metrics.web.server.request.autotime.enabled` is `true`, this instrumentation occurs for all requests. +Alternatively, when set to `false`, you can enable instrumentation by adding `@Timed` to a request-handling method in the same way the Spring MVC example above. By default, metrics are generated with the name `http.server.requests`. You can customize the name by setting the configprop:management.metrics.web.server.request.metric-name[] property.