SpringBoot之actuator
在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的更多相关文章
- springboot集成Actuator
Actuator监控端点,主要用来监控与管理. 原生端点主要分为三大类:应用配置类.度量指标类.操作控制类. 应用配置类:获取应用程序中加载的配置.环境变量.自动化配置报告等与SpringBoot应用 ...
- SpringBoot系列: Actuator监控
Sprng Boot 2 actuator变动加大, 网上很多资料都都已经过期. ============================配置项============================ ...
- SpringBoot 开启 Actuator
在生产环境中,需要实时或定期监控服务的可用性.spring-boot 的actuator(监控)功能提供了很多监控所需的接口.简单的配置和使用如下: 1.引入依赖: <dependency> ...
- SpringBoot集成actuator模块的基本使用
© 版权声明:本文为博主原创文章,转载请注明出处 1. 版本 SpringBoot:2.0.0.RELEASE 2. 集成 SpringBoot集成actuator模块非常简单,只需要引入actuat ...
- SpringBoot集成Actuator监控管理
1.说明 本文详细介绍Spring Boot集成Actuator监控管理的方法, 基于已经创建好的Spring Boot工程, 然后引入Actuator依赖, 介绍监控管理相关功能的使用. Sprin ...
- SpringBoot 之Actuator.
一.Actuator 介绍 Actuator 是 SpringBoot 项目中一个非常强大一个功能,有助于对应用程序进行监视和管理,通过 restful api 请求来监管.审计.收集应用的运行情况. ...
- springboot 监控 Actuator
springboot 提供了对项目的监控功能. 1.首先添加依赖包 <!-- https://mvnrepository.com/artifact/org.springframework.boo ...
- SpringBoot系列:五、SpringBoot使用Actuator
Actuator为springboot提供了运行状态监控的功能 通过集成它我们可以试试获取到应用程序的运行信息 首先,在pom.xml中引入起步依赖 <dependency> <gr ...
- Springboot之actuator未授权访问
copy 子杰的哈,懒的写了 0x01 未授权访问可以理解为需要授权才可以访问的页面由于错误的配置等其他原因,导致其他用户可以直接访问,从而引发各种敏感信息泄露. 0x02 Spring Boot ...
随机推荐
- 使用模拟对象(Mock Object)技术进行测试驱动开发
敏捷开发 敏捷软件开发又称敏捷开发,是一种从上世纪 90 年代开始引起开发人员注意的新型软件开发方法.和传统瀑布式开发方法对比,敏捷开发强调的是在几周或者几个月很短的时间周期,完成相对较小功能,并交付 ...
- sklearn中SVM调参说明
写在前面 之前只停留在理论上,没有实际沉下心去调参,实际去做了后,发现调参是个大工程(玄学).于是这篇来总结一下sklearn中svm的参数说明以及调参经验.方便以后查询和回忆. 常用核函数 1.li ...
- [转]PHP: 深入pack/unpack
From : http://my.oschina.net/goal/blog/195749 http://www.w3school.com.cn/php/func_misc_pack.asp PHP作 ...
- SQL Server:使用 PIVOT 行转列和 UNPIVOT 列转行
ylbtech-SQL Server:使用 PIVOT 行转列和 UNPIVOT 列转行 可以使用 PIVOT 和 UNPIVOT 关系运算符将表值表达式更改为另一个表.PIVOT 通过将表达式某一列 ...
- go语言之进阶篇主协程先退出导致子协程没来得及调用
1.主协程先退出导致子协程没来得及调用 示例: package main import ( "fmt" "time" ) //主协程退出了,其它子协程也要跟着退 ...
- Gridview利用DataFormatString属性设置数据格式
首 先把Gridview的AutoGenerateColumns属性设为False(默认是False),DataField选择相应的字段,特别需要注 意的是要把需要设置的字段的HtmlEncode属性 ...
- distinct 多列详解
1.distinct单列 select distinct(a) from tableA; 2.distinct多列 select distinct a,b,c from tableA; 注意此时是将a ...
- JS的scrollIntoView简单使用
scrollIntoView方法滚动当前元素,进入浏览器的可见区域 el.scrollIntoView(); // 等同于el.scrollIntoView(true) el.scrollIntoVi ...
- 开源ckplayer 网页播放器去logo去广告去水印修改
功能设置介绍 本教程涉及到以下各点,点击对应标题页面将直接滑动到相应内容: 1:修改或去掉播放器前置logo 2:修改或去掉右上角的logo 3:修改.关闭.设置滚动文字广告 4:去掉右边的开关灯分享 ...
- MySQL在线大表DDL操作 (转)
http://www.cnblogs.com/janehoo/p/5382474.html 线大表DDL操作的方法: 1.主从架构轮询修改 需要注意: a.主库会话级别的记录binglog的参数关闭 ...