前言
本文的源码地址
主要是完成微服务的监控,完成监控治理。可以查看微服务间的数据处理和调用,当它们之间出现了异常,就可以快速定位到出现问题的地方。
- springboot - version: 2.0
正文
依赖
maven 项目 在 pom.xml
文件中加入 actuator 的依赖:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
使用 Gradle 构建:
dependencies {
compile("org.springframework.boot:spring-boot-starter-actuator")
}
配置
需要注意的是 Spring Boot 2.0 相对于上个版本, Actuator 发生很多变化,
keys 的配置改变
旧的属性 | 新的属性 |
---|---|
endpoints.<id> |