在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. LaTeX技巧206:使用gather输入多行公式的技巧

    上文中提到了几个输入多行公式的环境,gather也是其中之一,gather输入的好处是每一行,他都会按照前文的编号计数器进行向下计数,这样保证了公式编号的连贯性.所以,当我们输入公式的每一行公式需要独 ...

  2. 虚拟机内存复用技术的比较(XEN系统)

    技术途径 业界就该问题定义为虚拟机内存复用(复用干嘛? 当然是为了跑更多的虚拟机呀!) :memory overcommit.围绕次问题主要有4种技术手段,下面简要介绍和分析: 1 气泡驱动(ball ...

  3. [转]Sphinx+Mysql+中文分词安装-实现中文全文搜索

    From : http://blog.csdn.net/lgm252008/article/details/5373436 1.什么是SphinxSphinx 是一个在GPLv2 下发布的一个全文检索 ...

  4. java实时监听日志写入kafka(转)

    原文链接:http://www.sjsjw.com/kf_cloud/article/020376ABA013802.asp 目的 实时监听某目录下的日志文件,如有新文件切换到新文件,并同步写入kaf ...

  5. swift3.0:NSURLSession的使用

    一.说明 NSURLSession是OC中的会话类,在Swift中变成URLSession类,它们的实现方式是一样的,下面的示例就Swift语法进行讲解和介绍. 二.介绍: URLSession 类支 ...

  6. CSS-页面滑屏滚动原理

    现在的网站有的时候为了简洁就是很多的单页滑屏滚动介绍,主要呈现方式有两种,一种是整体的元素一直排列下去,假设有五个需要展示的全屏页面,那么高度是500%,只是展示100%,剩下的可以通过transfo ...

  7. 解析oui.txt文件,通过MAC前缀获取Organization

    1.前言 OUI是指Organizationally unique identifier  (组织唯一标识符),签发给各类组织的唯一标识符.MAC地址共有6个字节48位组成,前3个字节体现了OUI,其 ...

  8. z-index的堆叠规则

    原文: https://www.cnblogs.com/starof/p/4424926.html 对于所有定位,最后都不免遇到两个元素试图放在同一位置上的情况.显然,其中一个必须盖住另一个.但,如何 ...

  9. [Docker] Converting from Docker Compose to Kubernetes

    kompose is a tool to help users who are familiar with docker-compose move to Kubernetes. kompose tak ...

  10. Python引用(import)文件夹下的py文件的方法

    Python的import包含文件功能就跟PHP的include类似,但更确切的说应该更像是PHP中的require,因为Python里的import只要目标不存在就报错程序无法往下执行.要包含目录里 ...