Ale*_*ndo 7 java spring-boot spring-boot-actuator micrometer
在MaximumUriTagsReachedMeterFilter内部配置RestTemplateMetricsAutoConfiguration类记录警告并停止收集,因为我使用uriVariables严重.
问题是我必须使用uri变量和查询参数构建URI并将其传递给org.springframework.web.client.RestTemplate.exchange.例如:
String url = "http://foo.example/api/resources/{id}";
// omitting uriVariables and queryParams maps
URI uri = UriComponentsBuilder.fromUriString(url)
.buildAndExpand(uriVariables)
.toUri();
uri = UriComponentsBuilder
.fromUri(uri)
.queryParams(queryParams)
.build()
.toUri();
restTemplate.exchange(
uri,
HttpMethod.GET,
requestEntity,
new ParameterizedTypeReference<Entity>(){}
);
Run Code Online (Sandbox Code Playgroud)
我真的不知道如何restTemplate.exchange()与uri变量和查询参数一起传递给参数化字符串URI.这将使检测代码能够在uri变量扩展之前挂钩,只获取一次度量标准uri标记.
此外,我正在利用RestTemplate指标定制HealthIndicator.我真的需要解决这个问题.
| 归档时间: |
|
| 查看次数: |
2470 次 |
| 最近记录: |