首页 > 编程语言 > 详细

SpringBoot Actuator

时间:2018-09-28 17:10:29      阅读:146      评论:0      收藏:0      [点我收藏+]

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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!