在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. 关于Java中的equals方法

    关于Java中的equals方法 欢迎转载,但是请填写本人的博客园原址https://www.cnblogs.com/JNovice/p/9347099.html 一.什么是equals方法 equa ...

  2. 利用Microsoft.Exchange.WebServices处理Office365邮件的几个属性

    使用Microsoft.Exchange.WebServices可以很方便操作Office365邮件.这里列出几个重要的属性. 通常,代码里会先定义一个WebServices对象 ExchangeSe ...

  3. nfd指令的详细说明

    在eterm上执行NFD:SHAPEK/CA*OW指令,返回如下: LN CXR OW RT FBC/TC RBD MIN/MAX TRVDATE R 01 CA 450.00 U U 00D/00D ...

  4. 第二章 Base64与URLBase64

    2.1.算法基本规则: 加密的算法公开 加密的密钥不公开 Base64算法公开.密钥也公开的特性不符合基本算法规则,所以很容易被破解,所以一般不用于企业级的加密操作. 注意:具体的算法与密钥(对于Ba ...

  5. 双语:Interprocess Communication 进程通信

    when one process creates a new process, the identity of the newly created process is passed to the p ...

  6. 七牛云存储 qiniu 域名 回收 文件上传 备份 下载 MD

    Markdown版本笔记 我的GitHub首页 我的博客 我的微信 我的邮箱 MyAndroidBlogs baiqiantao baiqiantao bqt20094 baiqiantao@sina ...

  7. Redis:解决分布式高并发修改同一个Key的问题

    本篇文章是通过watch(监控)+mutil(事务)实现应用于在分布式高并发处理等相关场景.下边先通过redis-cli.exe来测试多个线程修改时,遇到问题及解决问题. 高并发下修改同一个key遇到 ...

  8. windows 查看动态连接库和静态连接库的方法

    在window下查看动态库的导出函数可以用vs自带的Dependenc工具: 查看静态库的信息要用命令行来实现: dumpbin   /LINKERMEMBER   Test.lib   >   ...

  9. webkit-user-select:none 问题

    webkit-user-select:none 问题 学习了:https://bugs.webkit.org/show_bug.cgi?id=82692 最近两天做移动端游戏举报页面.遇到一个问题,移 ...

  10. RateLimiter 限流

    @RestControllerpublic class RateLimiterController { private RateLimiter rateLimiter = RateLimiter.cr ...