使用 Actuator 监控

参考文章:https://www.jianshu.com/p/ba85f56a2013

Actuator 提供对自身应用的监控、配置查看等。

步骤一:导入actuator 依赖

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

步骤二:在配置中加入属性参数

server:
  port: 8080

management:
  security:
    enabled: false #关掉安全认证
  port: 8080
  context-path: /monitor #actuator的访问路径
endpoints:
  shutdown:
    enabled: true
  beans:
    id: instances

步骤三:启动查看

 

浏览器访问:

原文地址:https://www.cnblogs.com/bytecodebuffer/p/10437951.html