<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
management:
endpoints:
web:
exposure:
include: prometheus
# job名称
- job_name: 'test'
# 刷新时间5s
scrape_interval: 5s
# 固定的
metrics_path: '/actuator/prometheus'
# 要监控的项目的端口
static_configs:
- targets: ['localhost:8080']