pom.xml文件引用依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!--将actuator监控的指标转为prometheus格式-->
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
将相关的metrics暴露出来
将服务ip加端口加入至server targets中
导入grafana JVM数据模板并展示