我已经开始使用 spring boot 2.0.0-Snapshot,我发现所有与 Metric 相关的类和接口(interface)都不存在?
例子: jar spring-boot-actuator-2.0.0.BUILD-SNAPSHOT.jar 没有包
org.springframework.boot.actuate.metrics.writer at all
他们是否搬到了其他地方?
最佳答案
在 Spring Boot 2 中,以前的指标实现已被与 Micrometer 的集成所取代。 .来自发行说明:
Spring Boot’s own metrics have been replaced with support, including auto-configuration, for Micrometer and dimensional metrics. You can learn more about Micrometer in its user manual and Spring Boot’s reference guide
我找不到任何从 1.x Spring Boot Metrics 迁移到 2.x Spring Boot Metrics 的指南,但这个变化是最近发生的,所以我怀疑任何此类文档都是 TODO。与此同时,你也许可以深入研究 Pull Request或关注Spring Boot 2 docs ...
Micrometer provides a separate module for each supported monitoring system. Depending on one (or more) of these modules is sufficient to get started with Micrometer in your Spring Boot application. To learn more about Micrometer’s capabilities, please refer to its reference documentation.
关于spring-boot - Spring Boot 2.x 指标类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46749603/