在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. [Web 前端] 流行的JavaScript库 ——jQuery

    cp : https://www.cnblogs.com/zhoushihui/p/5141767.html   1.为了简化 JavaScript 的开发, 一些 JavsScript 库诞生了. ...

  2. Python数据分析笔记

    最近在看Python数据分析这本书,随手记录一下读书笔记. 工作环境 本书中推荐了edm和ipython作为数据分析的环境,我还是刚开始使用这种集成的环境,觉得交互方面,比传统的命令行方式提高了不少. ...

  3. python-opencv旋转图像,保持图像不被裁减

    python-opencv旋转图像,保持图像不被裁减   import cv2 from math import * def remote(img,degree): #degree左转 img = c ...

  4. SVG Path路径使用(一)

    一.<path> 标签 <path> 标签用来定义路径. 下面的命令可用于路径数据: M = moveto L = lineto H = horizontal lineto V ...

  5. golang的日志系统log和glog

    go语言有一个标准库,log,提供了最基本的日志功能,但是没有什么高级的功能,如果需要高级的特性,可以选择glog或log4go. 参考:https://cloud.tencent.com/devel ...

  6. java将XML文档转换成json格式数据

    功能 将xml文档转换成json格式数据 说明 依赖包:1. jdom-2.0.2.jar : xml解析工具包;2. fastjson-1.1.36.jar : 阿里巴巴研发的高性能json工具包 ...

  7. 在linux下 用p7zip 命令行下 解压 iso文件

    todo tomorrorw! 在linux下可以通过 mount IOSFILE.iso /media/myiso/ -o loop 这种方式挂载,然后直接从 目录中拷贝 iso的内容出来就可以. ...

  8. Java_Freemarker

    ylbtech-Miscellaneos:Java_Freemarker FreeMarker是一款模板引擎: 即一种基于模板和要改变的数据, 并用来生成输出文本(HTML网页.电子邮件.配置文件.源 ...

  9. Verilog 加法器和减法器(6)

    为了减小行波进位加法器中进位传播延迟的影响,可以尝试在每一级中快速计算进位,如果能在较短时间完成计算,则可以提高加法器性能. 我们可以进行如下的推导: 设 gi=xi&yi, pi = xi ...

  10. ODBC更新记录集提示”记录集为只读“

    创建的ODBC应用程序默认的记录集不具有只读属性,但是再更新记录表时会提示”记录集为只读“,这是为什么呢? 今天看书找到了答案: 因为MFC中的数据库类不支持需要连接两个或者多个表的记录集更新,如果选 ...