排查
打印Debug日志,并访问metric_path,发现找不到resource,是版本问题,换了actuator版本后解决
解决方法
版本冲突
换版本
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<version>2.3.5.RELEASE</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
<version>1.11.2</version>
</dependency>