user3444718
user3444718

Reputation: 1625

Spring boot 2 upgrade issue with actuator

Config: springCloudVersion = 'Finchley.SR1' springBootVersion = '2.0.2.RELEASE'

Getting below error:

Caused by: java.lang.ClassNotFoundException: org.springframework.boot.actuate.metrics.CounterService

There is no CounterService class in this release of spring-starter-actuator-2.0.2.RELEASE?? Ref: https://docs.spring.io/spring-boot/docs/2.0.2.RELEASE/api/

Upvotes: 1

Views: 3114

Answers (1)

Thiru
Thiru

Reputation: 2699

Yes, CounterService is been removed in SpringBoot 2.0.

We faced the same issue and we used MeterRegistry from micrometer instead of CounterService

    <dependency>
        <groupId>io.micrometer</groupId>
        <artifactId>micrometer-registry-prometheus</artifactId>
    </dependency>

Please refer migration guide here

Upvotes: 5

Related Questions