执行器的 Spring Boot 2 升级问题

use*_*718 1 spring-boot spring-boot-actuator

配置: springCloudVersion = 'Finchley.SR1' springBootVersion = '2.0.2.RELEASE'

得到以下错误:

Caused by: java.lang.ClassNotFoundException: org.springframework.boot.actuate.metrics.CounterService
Run Code Online (Sandbox Code Playgroud)

这个版本的 spring-starter-actuator-2.0.2.RELEASE 中没有 CounterService 类??参考:https : //docs.spring.io/spring-boot/docs/2.0.2.RELEASE/api/

Thi*_*iru 5

是的,CounterService 在 SpringBoot 2.0 中被移除了。

我们遇到了同样的问题,我们使用MeterRegistry了千分尺而不是CounterService

    <dependency>
        <groupId>io.micrometer</groupId>
        <artifactId>micrometer-registry-prometheus</artifactId>
    </dependency>
Run Code Online (Sandbox Code Playgroud)

在此处参考迁移指南