Skip to content

Commit

Permalink
add new md
Browse files Browse the repository at this point in the history
  • Loading branch information
LYDongD committed Aug 8, 2019
1 parent baeea96 commit b73d3b9
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
1 change: 1 addition & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
* [启动](source_code/spring/springboot/bootstrap.md)
* [条件注解](source_code/spring/springboot/condition.md)
* [自动配置](source_code/spring/springboot/autoConfiguration.md)
* [监控](source_code/spring/springboot/actuator.md)
* [mybatis](source_code/mybatis/README.md)
* [mybatis基础功能](source_code/mybatis/mybatis.md)
* [mybatis源码之最佳范式](source_code/mybatis/mybatis_source.md)
Expand Down
72 changes: 72 additions & 0 deletions source_code/spring/springboot/actuator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
## Actuator 应用监控

### 用法

[参考](http://www.ityouknow.com/springboot/2018/02/06/spring-boot-actuator.html)

> 添加依赖
通过web容器暴露http端口

```
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
</dependencies>
```

> 配置
properties配置

```
info.app.name=spring-boot-actuator
info.app.version= 1.0.0
info.app.test=test
management.endpoints.web.exposure.include=*
management.endpoint.health.show-details=always
#management.endpoints.web.base-path=/monitor
management.endpoint.shutdown.enabled=true
```
yml配置

```
info:
app:
name: cabinet-query-server
version: 1.0.0
management:
health:
mail:
enabled: false
endpoints:
web:
exposure:
# 生产环境由于安全性的问题,注意不要暴露敏感端点
include: "*"
exclude: env
base-path: /actuator
endpoint:
health:
show-details: always
```

> 常用功能
* heap dump
* thread dump
* 健康检查等



0 comments on commit b73d3b9

Please sign in to comment.