Spring Boot Actuator:健康检查、审计、统计和监控

Spring Boot Actuator可以帮助你监控和管理Spring Boot应用,

比如健康检查、审计、统计和HTTP追踪等。所有的这些特性可以通过JMX或者HTTP endpoints来获得。

Actuator同时还可以与外部应用监控系统整合,比如 Prometheus, Graphite, DataDog, Influx, Wavefront, New Relic等。这些系统提供了非常好的仪表盘、图标、分析和告警等功能,使得你可以通过统一的接口轻松的监控和管理你的应用。

Actuator使用Micrometer来整合上面提到的外部应用监控系统。这使得只要通过非常小的配置就可以集成任何应用监控系统。

下面讲解下Actuator如何创建pom.xml文件

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

yml文件中

# 加载所有的端点/默认只加载了 info / health
management:
  endpoint:
    shutdown:
      #可以关闭制定的端点
      enabled: false
    health:
      show-details: always
  endpoints:
    web:
      exposure:
        include: '*'

 然后链接访问,则表示成功.

 

 附上详细文件链接:https://www.jianshu.com/p/d5943e303a1f

posted on 2020-07-21 11:50  手撕高达的村长  阅读(300)  评论(0编辑  收藏  举报

导航