# 54.3.2 Spring WebFlux指标

自动配置可以检测WebFlux控制器处理的所有请求。你还可以使用一个助手类`RouterFunctionMetrics`来检测使用WebFlux函数式编程模型的应用程序。

默认情况下，使用`http.server.requests`这个名称来生成度量标准。你可以通过设置`management.metrics.web.server.requests-metric-name`属性来自定义名称。

默认情况下，基于注解的编程模型的webflux相关指标会被标记上以下信息：

* `方法`，请求的方法(例如，`GET`或`POST`)。
* `uri`，请求在变量替换之前的uri模板，如果可能的话(例如`/api/person/{id}`)。
* `状态`，响应的HTTP状态码(例如，`200`或`500`)。
* `异常`，处理请求时抛出的任何异常的简单类名。

  要自定义标签，请提供一个实现`WebFluxTagsProvider`的`@Bean`。

默认情况下，函数式编程模型的指标会被标记上以下信息：

* `方法`，请求的方法(例如，`GET`或`POST`)。
* `uri`，请求在变量替换之前的uri模板，如果可能的话(例如`/api/person/{id}`)。
* `状态`，响应的HTTP状态码(例如，`200`或`500`)。

  要自定义标签，请在`RouterFunctionMetrics`实例上使用`defaultTags`方法。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jack80342.gitbook.io/spring-boot/v.-spring-boot-actuator/54.-metrics/54.3-supported-metrics/54.3.2-spring-webflux-metrics.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
