安装
#pom导入
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
#yml配置
management:
endpoints:
web:
exposure:
include: "*"
endpoint:
health:
show-details: ALWAYS
监控配置
#抓取配置
scrape_configs:
#Java程序监控
- job_name: service
metrics_path: "/actuator/prometheus"
static_configs:
- targets: ["localhost:8090"]
labels:
application: applciation1
- targets: ["localhost:9999"]
labels:
application: applciation2
监控大盘
登陆grafana新建看板导入
https://grafana.com/grafana/dashboards/4701-jvm-micrometer/
https://grafana.com/grafana/dashboards/12900-springboot-apm-dashboard/