-
Notifications
You must be signed in to change notification settings - Fork 231
metrics
liubao edited this page Aug 29, 2022
·
3 revisions
Spring Cloud Huawei使用Spring Cloud Actuator上报监控信息,并增加了很多监控指标,比如服务治理相关的指标。
一般会通过prometheus来上报监控信息。在项目中引入相关依赖:
<dependency>
<groupId>com.huaweicloud</groupId>
<artifactId>spring-cloud-starter-huawei-actuator</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
开启 health, prometheus等监控端点, 在 application.yml
中配置:
management:
endpoint:
health:
group:
readiness:
include: registry
endpoints:
web:
exposure:
include: "health,prometheus"
metrics:
tags:
application: ${spring.application.name}
- 查看健康状态
http://localhost:9094/actuator/health/readiness
http://localhost:9094/actuator/health/liveness
- 查看监控(metrics) 数据
http://localhost:9094/actuator/prometheus
可以再ServiceStage
中使用这些端点,实现灵活的滚动升级,以及往 AOM
上报监控数据。
-
使用Spring Cloud Huawei功能
-
使用服务治理
-
生态集成
-
迁移改造问题
-
配置参考
-
优秀实践
-
常见问题