在springBoot中集成actuator可以很方便的管理和监控应用的状态。

暴露的Restful接口有:

HTTP方法 路径 描述 鉴权
GET /autoconfig 查看自动配置的使用情况 true
GET /configprops 查看配置属性,包括默认配置 true
GET /beans 查看bean及其关系列表 true
GET /dump 打印线程栈 true
GET /env 查看所有环境变量 true
GET /env/{name} 查看具体变量值 true
GET /health 查看应用健康指标 false
GET /info 查看应用信息 false
GET /mappings 查看所有url映射 true
GET /metrics 查看应用基本指标 true
GET /metrics/{name} 查看具体指标 true
POST /shutdown 关闭应用 true
GET /trace 查看基本追踪信息 true

其中有不少请求需要鉴权才能访问,由于我们的应用基本都是在通过Nginx暴露给外网的,我们可以在配置文件禁用鉴权拦截。

# 禁用actuator管理端鉴权
management.security.enabled=false
# 启用shutdown host:port/shutdown
endpoints.shutdown.enabled=true
# 禁用密码验证
endpoints.shutdown.sensitive=false

通过访问http://IP:port/metrics可以得到类似如下信息:

 {
"mem": 372386,
"mem.free": 129077,
"processors": 4,
"instance.uptime": 12149,
"uptime": 20629,
"systemload.average": -1.0,
"heap.committed": 302080,
"heap.init": 129024,
"heap.used": 173002,
"heap": 1807872,
"nonheap.committed": 72448,
"nonheap.init": 2496,
"nonheap.used": 70307,
"nonheap": 0,
"threads.peak": 57,
"threads.daemon": 53,
"threads.totalStarted": 64,
"threads": 55,
"classes": 9724,
"classes.loaded": 9724,
"classes.unloaded": 0,
"gc.ps_scavenge.count": 11,
"gc.ps_scavenge.time": 151,
"gc.ps_marksweep.count": 2,
"gc.ps_marksweep.time": 242,
"counter.servo.eurekaserver.replication.batchsize.count": 0,
"counter.servo.eurekaserver.replication.batchsize.totaltime": 0,
"gauge.servo.eurekaserver.replication.batchsize.stddev": 0.0,
"gauge.servo.eurekaserver.replication.batchsize.percentile_50": 0.0,
"gauge.servo.eurekaserver.replication.batchsize.percentile_95": 0.0,
"gauge.servo.eurekaserver.replication.batchsize.percentile_99": 0.0,
"gauge.servo.eurekaserver.replication.batchsize.percentile_99_50": 0.0,
"counter.servo.eurekaserver.replication.acceptedtasks": 0,
"counter.servo.eurekaserver.replication.replayedtasks": 0,
"counter.servo.eurekaserver.replication.expiredtasks": 0,
"counter.servo.eurekaserver.replication.overriddentasks": 0,
"counter.servo.eurekaserver.replication.queueoverflows": 0,
"gauge.servo.eurekaserver.replication.acceptorqueuesize": 0,
"gauge.servo.eurekaserver.replication.pendingjobrequests": 1,
"gauge.servo.eurekaserver.replication.availablejobs": 0,
"gauge.servo.eurekaserver.replication.reprocessqueuesize": 0,
"gauge.servo.eurekaserver.replication.queuesize": 0,
"counter.servo.count": 0,
"counter.servo.count-minus-replication": 0,
"counter.servo.eurekaserver.replication.executiontime.count": 0,
"counter.servo.eurekaserver.replication.executiontime.totaltime": 0,
"gauge.servo.eurekaserver.replication.executiontime.stddev": 0.0,
"gauge.servo.eurekaserver.replication.executiontime.percentile_50": 0.0,
"gauge.servo.eurekaserver.replication.executiontime.percentile_95": 0.0,
"gauge.servo.eurekaserver.replication.executiontime.percentile_99": 0.0,
"gauge.servo.eurekaserver.replication.executiontime.percentile_99_50": 0.0,
"counter.servo.eurekaserver.replication.numberofsuccessfulexecutions": 0,
"counter.servo.eurekaserver.replication.numberoftransienterrors": 0,
"counter.servo.eurekaserver.replication.numberofpermanenterrors": 0,
"normalized.servo.serialize-all.totaltime": 0.0,
"normalized.servo.serialize-all.count": 0.0,
"gauge.servo.serialize-all.min": 0.0,
"gauge.servo.serialize-all.max": 0.0,
"normalized.servo.serialize-all-delta.totaltime": 0.0,
"normalized.servo.serialize-all-delta.count": 0.0,
"gauge.servo.serialize-all-delta.min": 0.0,
"gauge.servo.serialize-all-delta.max": 0.0,
"normalized.servo.serialize-all_remote_region.totaltime": 0.0,
"normalized.servo.serialize-all_remote_region.count": 0.0,
"gauge.servo.serialize-all_remote_region.min": 0.0,
"gauge.servo.serialize-all_remote_region.max": 0.0,
"normalized.servo.serialize-all-delta_remote_region.totaltime": 0.0,
"normalized.servo.serialize-all-delta_remote_region.count": 0.0,
"gauge.servo.serialize-all-delta_remote_region.min": 0.0,
"gauge.servo.serialize-all-delta_remote_region.max": 0.0,
"normalized.servo.serialize-one.totaltime": 0.0,
"normalized.servo.serialize-one.count": 0.0,
"gauge.servo.serialize-one.min": 0.0,
"gauge.servo.serialize-one.max": 0.0,
"normalized.servo.serialize-one-vip.totaltime": 0.0,
"normalized.servo.serialize-one-vip.count": 0.0,
"gauge.servo.serialize-one-vip.min": 0.0,
"gauge.servo.serialize-one-vip.max": 0.0,
"normalized.servo.compress-payload.totaltime": 0.0,
"normalized.servo.compress-payload.count": 0.0,
"gauge.servo.compress-payload.min": 0.0,
"gauge.servo.compress-payload.max": 0.0,
"gauge.servo.responsecachesize": 0,
"counter.servo.discovery-peernodeclient-localhost_reuse": 0,
"counter.servo.discovery-peernodeclient-localhost_createnew": 0,
"counter.servo.discovery-peernodeclient-localhost_request": 0,
"counter.servo.discovery-peernodeclient-localhost_release": 0,
"counter.servo.discovery-peernodeclient-localhost_delete": 0,
"normalized.servo.discovery-peernodeclient-localhost_requestconnectiontimer.totaltime": 0.0,
"normalized.servo.discovery-peernodeclient-localhost_requestconnectiontimer.count": 0.0,
"gauge.servo.discovery-peernodeclient-localhost_requestconnectiontimer.min": 0.0,
"gauge.servo.discovery-peernodeclient-localhost_requestconnectiontimer.max": 0.0,
"normalized.servo.discovery-peernodeclient-localhost_createconnectiontimer.totaltime": 0.0,
"normalized.servo.discovery-peernodeclient-localhost_createconnectiontimer.count": 0.0,
"gauge.servo.discovery-peernodeclient-localhost_createconnectiontimer.min": 0.0,
"gauge.servo.discovery-peernodeclient-localhost_createconnectiontimer.max": 0.0,
"gauge.servo.connectioncount": 0,
"gauge.servo.localregistrysize": 0,
"gauge.servo.numofreplicationsinlastmin": 0,
"gauge.servo.isbelowrenewthreshold": 0,
"gauge.servo.numofrenewsinlastmin": 0,
"gauge.servo.numofrenewsperminthreshold": 1,
"gauge.servo.numofelementsininstancecache": 0,
"normalized.servo.eureka-connection-cleaner-time.totaltime": 0.0,
"normalized.servo.eureka-connection-cleaner-time.count": 0.0,
"gauge.servo.eureka-connection-cleaner-time.min": 0.0,
"gauge.servo.eureka-connection-cleaner-time.max": 0.0,
"counter.servo.eureka-connection-cleaner-failure": 0,
"httpsessions.max": -1,
"httpsessions.active": 0
}

如果只关心某部分参数可以使用:http://IP:port/metrics/mem来查看特定参数的值

{"mem":373311}

SpringBoot之actuator的更多相关文章

  1. springboot集成Actuator

    Actuator监控端点,主要用来监控与管理. 原生端点主要分为三大类:应用配置类.度量指标类.操作控制类. 应用配置类:获取应用程序中加载的配置.环境变量.自动化配置报告等与SpringBoot应用 ...

  2. SpringBoot系列: Actuator监控

    Sprng Boot 2 actuator变动加大, 网上很多资料都都已经过期. ============================配置项============================ ...

  3. SpringBoot 开启 Actuator

    在生产环境中,需要实时或定期监控服务的可用性.spring-boot 的actuator(监控)功能提供了很多监控所需的接口.简单的配置和使用如下: 1.引入依赖: <dependency> ...

  4. SpringBoot集成actuator模块的基本使用

    © 版权声明:本文为博主原创文章,转载请注明出处 1. 版本 SpringBoot:2.0.0.RELEASE 2. 集成 SpringBoot集成actuator模块非常简单,只需要引入actuat ...

  5. SpringBoot集成Actuator监控管理

    1.说明 本文详细介绍Spring Boot集成Actuator监控管理的方法, 基于已经创建好的Spring Boot工程, 然后引入Actuator依赖, 介绍监控管理相关功能的使用. Sprin ...

  6. SpringBoot 之Actuator.

    一.Actuator 介绍 Actuator 是 SpringBoot 项目中一个非常强大一个功能,有助于对应用程序进行监视和管理,通过 restful api 请求来监管.审计.收集应用的运行情况. ...

  7. springboot 监控 Actuator

    springboot 提供了对项目的监控功能. 1.首先添加依赖包 <!-- https://mvnrepository.com/artifact/org.springframework.boo ...

  8. SpringBoot系列:五、SpringBoot使用Actuator

    Actuator为springboot提供了运行状态监控的功能 通过集成它我们可以试试获取到应用程序的运行信息 首先,在pom.xml中引入起步依赖 <dependency> <gr ...

  9. Springboot之actuator未授权访问

    copy 子杰的哈,懒的写了 0x01  未授权访问可以理解为需要授权才可以访问的页面由于错误的配置等其他原因,导致其他用户可以直接访问,从而引发各种敏感信息泄露. 0x02 Spring Boot ...

随机推荐

  1. RFC 868 -- TIME Protocol

    INTERNET STANDARD Errata Exist Network Working Group J. Postel - ISI Request for Comments: 868 K. Ha ...

  2. 【BZOJ】【3339】Rmq Problem

    离线+线段树 Orz Hzwer,引用题解: 这一题在线似乎比较麻烦 至于离线.. 首先按照左端点将询问排序 然后一般可以这样考虑 首先如何得到1-i的sg值呢 这个可以一开始扫一遍完成 接着考虑l- ...

  3. Altium Designer 13 插件安装

    关键词:Altium Designer 13 :导入 Protel 99SE 很多人反应Altium Designer 13等版本无法 Protel 99SE的文件,实际上这是由于新的安装机制导致,新 ...

  4. kafka 主要内容介绍

    1.       kafka介绍 1.1.       主要功能 根据官网的介绍,ApacheKafka®是一个分布式流媒体平台,它主要有3种功能: 1:It lets you publish and ...

  5. 遛老虎网 http://6laohu.com/

    遛老虎网 http://6laohu.com/

  6. 一个ActiveX control的创建过程

    创建 根据这篇文章的介绍:http://www.cnblogs.com/time-is-life/p/6354152.html 来创建,里面包含了创建的基本过程以及属性事件方法的使用. 使用: 参考文 ...

  7. installers PHPManager

    === Verbose logging started: // :: Build type: SHIP UNICODE 5.00.10011.00 Calling process: C:\Progra ...

  8. Creating objects on stack or heap

    class Player {  private: int health;  int strength;  int agility; public: void move(); void attackEn ...

  9. Python MySQLdb模块连接操作mysql数据库实例_python

    mysql是一个优秀的开源数据库,它现在的应用非常的广泛,因此很有必要简单的介绍一下用python操作mysql数据库的方法.python操作数据库需要安装一个第三方的模块,在http://mysql ...

  10. Oracle PGA

    PGA(Process Global Area),是server process一段私有内存区,它包含有全局变量,数据结构和一些控制信息.在Oracle8i 中,PGA调整非常复杂,要调整SORT_A ...