伺服器及java效能監控
環境:
springboot 2.0.6.RELEASE
centos 7.2
springboot+actuator+prometheus+node_exporter
實現效果:
實現對cpu、記憶體、磁碟以及java專案jvm、請求等一系列監控。
java專案配置:
pom.xml:
<!-- 監控 -->
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-actuator -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/io.micrometer/micrometer-registry-prometheus -->
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
yml:
management:
server:
port: 8080
endpoints:
web:
base-path: /
exposure:
include: health,info,env,prometheus,metrics,httptrace,threaddump,heapdump,springmetrics
endpoint:
health:
show-details: always
prometheus:
enabled: true
metrics:
export:
prometheus:
enabled: true
step: 1m
descriptions: true
伺服器:
grafana:
https://blog.csdn.net/clevercode/article/details/78001654
Prometheus:
https://blog.csdn.net/xiegh2014/article/details/79192431
node_exporter:
https://blog.csdn.net/xiongpai1971/article/details/80171386