> For the complete documentation index, see [llms.txt](https://jack80342.gitbook.io/spring-boot/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jack80342.gitbook.io/spring-boot/v.-spring-boot-actuator/54.-metrics/54.3-supported-metrics/54.3.3-resttemplate-metrics.md).

# 54.3.3 RestTemplate指标

使用自动配置的`RestTemplateBuilder`创建的任何`RestTemplate`工具都是启用的。也可以手动应用`MetricsRestTemplateCustomizer`。

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

默认情况下，由装备的`RestTemplate`生成的指标用以下信息标记：

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

  要自定义标记，请提供一个实现`RestTemplateExchangeTagsProvider`的`@Bean`。在`RestTemplateExchangeTags`中有方便的静态函数。
