1、新建SpringBoot项目
2、引入pom依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
<version>1.6.2</version>
</dependency>
3、更改application.properties
server.port=8088
spring.application.name=spg
management.endpoints.web.exposure.include=*