Commit 3fa8fe85 authored by Brian Clozel's avatar Brian Clozel

Deprecate RouterFunctionMetrics

Spring Boot now deploys both annotation-based and functional endpoints
under the same `HttpHandler`; this means the currently auto-configured
`MetricsWebFilter` is instrumenting all endpoints to produce metrics.

There is no need for a WebFlux functional specific support.
This commit removes mentions of `RouterFunctionMetrics` in the docs and
deprecates that class.

Closes gh-12833
parent 77be10e7
......@@ -36,7 +36,9 @@ import org.springframework.web.reactive.function.server.ServerResponse;
*
* @author Jon Schneider
* @since 2.0.0
* @deprecated in favor of the auto-configured {@link MetricsWebFilter}
*/
@Deprecated
public class RouterFunctionMetrics {
private final MeterRegistry registry;
......
......@@ -1684,14 +1684,12 @@ To customize the tags, provide a `@Bean` that implements `WebMvcTagsProvider`.
[[production-ready-metrics-web-flux]]
==== Spring WebFlux Metrics
Auto-configuration enables the instrumentation of all requests handled by WebFlux
controllers. You can also use a helper class, `RouterFunctionMetrics`, to instrument
applications that use WebFlux's functional programming model.
controllers and functional handlers.
By default, metrics are generated with the name `http.server.requests`. You can customize
the name by setting the `management.metrics.web.server.requests-metric-name` property.
By default, WebFlux-related metrics for the annotation-based programming model are tagged
with the following information:
By default, WebFlux-related metrics are tagged with the following information:
* `method`, the request's method (for example, `GET` or `POST`).
* `uri`, the request's URI template prior to variable substitution, if possible (for
......@@ -1702,17 +1700,6 @@ request.
To customize the tags, provide a `@Bean` that implements `WebFluxTagsProvider`.
By default, metrics for the functional programming model are tagged with the following
information:
* `method`, the request's method (for example, `GET` or `POST`).
* `uri`, the request's URI template prior to variable substitution, if possible (for
example, `/api/person/{id}`).
* `status`, the response's HTTP status code (for example, `200` or `500`).
To customize the tags, use the `defaultTags` method on your `RouterFunctionMetrics`
instance.
[[production-ready-metrics-rest-template]]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment