【问题标题】:How to produce metrics of URI correctly in spring boot 2 + webflux如何在 spring boot 2 + webflux 中正确生成 URI 指标
【发布时间】:2018-12-10 13:01:45
【问题描述】:

我在使用 spring boot 2.0.3 + spring webflux(功能端点)+指标时遇到问题。根据official doc

生成的 uri 指标应该是变量替换之前请求的 URI 模板

这意味着生成的 URI 指标应该类似于 /api/person/{id},而不是 /api/person/123。但是,当我使用此链接 http://localhost:8080/actuator/metrics/http.server.requests 在我的 Spring Boot 应用程序上查询这些指标时,我得到了这些 URI:

/api/person/2
/api/person/33
/api/person/12

为了重现这个问题,我在这里放了一个示例代码:https://gitlab.com/itsleon/demo

有人可以解释一下这个问题吗?提前致谢!

【问题讨论】:

    标签: spring-boot metrics spring-webflux


    【解决方案1】:

    有一个open issue for that in Spring Boot。 目前,Spring WebFlux fn 不提供与当前请求匹配的 URI 模式的信息,因此目前无法实现。

    您的评估是正确的,目前已收集完整的请求 URI。

    【讨论】:

      猜你喜欢
      • 2018-05-11
      • 2018-06-24
      • 2020-11-22
      • 1970-01-01
      • 1970-01-01
      • 2020-09-30
      • 1970-01-01
      • 2018-10-11
      • 2019-04-10
      相关资源
      最近更新 更多