码迷,mamicode.com
首页 > 编程语言 > 详细

SpringBoot Actuator

时间:2018-09-28 17:35:51      阅读:143      评论:0      收藏:0      [点我收藏+]

标签:需要   uri   space   bin   pen   ring   man   manage   启动   

SpringBoot Actuator 提供了检查项目内部信息的一整套API,通常在项目启动时可以看到。

1.引入依赖包

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

2.配置application.yml

management:
  context-path: /actuator
  address: 127.0.0.1 #只有当配置了port,bind-address才会生效.
  port: 8091
  security:
    #如果应用仅需要探活,此处设为true(默认值)
    enabled: false # 如果设为false,且没有bind-address到127.0.0.1,会导致 env info beans trace 的泄露
  health: # 这个部分配置/actuator/health 接口返回的信息,包含disk db ldap es等,defaults:enabled:false 时,仅返回应用是否启动.
    defaults:
      enabled: true # 默认true,会检查磁盘状态.设为false不检查磁盘状态;
    diskspace:
      enabled: false # 设为false,不返回磁盘状态
endpoints:
  enabled: false
  health:
    enabled: true
  trace:
    enabled: false # 设为false,访问/actuator/health 返回404
    sensitive: true

 

SpringBoot Actuator

标签:需要   uri   space   bin   pen   ring   man   manage   启动   

原文地址:https://www.cnblogs.com/zhengwenqiang/p/9719569.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!