zoukankan      html  css  js  c++  java
  • Spring Boot 监控与管理

    Spring Boot 在 Start POMs中提供了一个特殊的依赖模块 spring-boot-start-actuator ,引入改模块能自动为Spring Boot构建应用提供一系列用于监控的端点。

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

     通过这些端点我们可以实时获取应用的各项监控指标:

          比如访问 /health 端点,我们可以获取如下信息;

    {
        "status":"UP",
        "diskSpace":{
              "status":"UP",
              "total":"491270",
              "free":"383870",
              "threshold":"10485670"
        }     
    }

    使用Spring Cloud的各个组件后,他的返回会变得非常丰富,有助于我们定制个性化的监控策略。

    根据原生端点的作用,可以将原生端点分为以下三大类:

        应用配置类:例如:/autoconfig 获取应用自动化配置报告。

        度量指标类:/metrics: 各类重要度量指标,比如内存信息,线程信息、垃圾回收信息。

        操作控制类:/shutdown ,在配置文件中开启后,访问应用的/shutdown端点就能实现远程关闭该应用的操作。     

  • 相关阅读:
    线程3 线程池和文件下载服务器
    线程 2
    线程 1
    线程间操作
    编写高质量的代码-------从命名开始
    基于.NET平台常用的框架整理
    消息队列
    我是一个线程
    linux 网络命令
    css hack比较全 --- 转
  • 原文地址:https://www.cnblogs.com/taiguyiba/p/9147505.html
Copyright © 2011-2022 走看看