Spring Boot Acuator提供了很多监控端点,可使用 http://{ip}:{port}/{endpoint}访问此类端点,从而了解程序运行情况
Spring 监控点梳理 (Spring boot actuator):
-------------------------------------------------------------------------------------------------------------------------------------------
autoconfig 显示自动配置信息 GET 敏感
beans 显示上下文所有的spring bean GET 非敏感
configprops 显示所有@configurationProperties的配置属性列表 GET 敏感
dump 显示现成活动快照 GET 敏感
env 显示当前应用环境变量 GET 敏感
health 显示当前应用健康状况,此值由HealthInficator的实现类提供, GET 非敏感
当应用开启安全保护时,对于未经允许的用户请求只会显示简单
状态,如果已认证则展示详情
info 显示应用信息,可用info.{*}属性自定义info端点公开的数据 GET 非敏感
mappings 显示所有@requestmapping的路径列表 GET 敏感
metrics 显示应用的度量标准信息 GET 敏感
shutdown 关闭应用(需要yml里配置end-points.shutdown.enable = true) POST 敏感
trace 显示跟踪信息(默认last 100个请求) GET 敏感
-------------------------------------------------------------------------------------------------------------------------------------------
如何整合 Actuator
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>