spring boot actuator 简单使用
spring boot admin + spring boot actuator + erueka 微服务监控
简单的spring boot actuator 使用
POM
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<version>1.5.6.RELEASE</version>
</dependency>
application.yml 这里开启了SpringSecurity保护,一般应用上,我们使用form作为用户登录,如果需要监控程序,那么我们会需要一个与应用业务无关的账户.可以设置一个账户角色为admin,随便什么的,可以使用httpbasic验证
#开启shutdown的安全验证
management:
security:
enabled: true
roles: USER
# port: 8060
# address: 127.0.0.1
health:
mail:
enabled: false
#允许关闭请求
endpoints:
shutdown:
enabled: false
httpbasic验证,密码必须是经过basic64编码,这是编码,不是加密

带着请求头去请求,返回一大串数据
{
"mem": 1289755,
"mem.free": 954940,
"processors": 4,
"instance.uptime": 268073,
"uptime": 286927,
"systemload.average": -1,
"heap.committed": 1188352,
"heap.init": 391168,
"heap.used": 233411,
"heap": 5563392,
"nonheap.committed": 103808,
"nonheap.init": 2496,
"nonheap.used": 101404,
"nonheap": 0,
"threads.peak": 64,
"threads.daemon": 45,
"threads.totalStarted": 151,
"threads": 49,
"classes": 13708,
"classes.loaded": 13750,
"classes.unloaded": 42,
"gc.ps_scavenge.count": 17,
"gc.ps_scavenge.time": 331,
"gc.ps_marksweep.count": 3,
"gc.ps_marksweep.time": 371,
"counter.servo.eurekaclient.transport.request": 0,
"gauge.servo.eurekaclient.registration.lastheartbeatsec_00015": 0,
"gauge.servo.eurekaclient.registration.lastheartbeatsec_00030": 0,
"normalized.servo.rest.totaltime": 1.6546110833333332,
"normalized.servo.rest.count": 0.016666666666666666,
"gauge.servo.rest.min": 99.276665,
"gauge.servo.rest.max": 99.276665,
"counter.servo.timeouts": 0,
"counter.servo.rejectedexecutions": 0,
"counter.servo.throwables": 0,
"gauge.servo.threadpoolused": 0,
"gauge.servo.eurekaclient.registry.lastupdatesec_00240": 0,
"normalized.servo.eurekaclient.transport.latency.totaltime": 0,
"normalized.servo.eurekaclient.transport.latency.count": 0,
"gauge.servo.eurekaclient.transport.latency.min": 0,
"gauge.servo.eurekaclient.transport.latency.max": 0,
"gauge.servo.eurekaclient.registration.lastheartbeatsec_00480": 0,
"gauge.servo.eurekaclient.transport.currentsessionduration": 261187,
"gauge.servo.response.index": 158,
"gauge.servo.eurekaclient.registry.lastupdatesec_00060": 0,
"counter.servo.discoveryclient_reconcilehashcodemismatch": 0,
"normalized.servo.discoveryclient_fetchregistry.totaltime": 0.42151759999999994,
"normalized.servo.discoveryclient_fetchregistry.count": 0.03333333333333333,
"gauge.servo.discoveryclient_fetchregistry.min": 9.916665,
"gauge.servo.discoveryclient_fetchregistry.max": 15.374391,
"counter.servo.discoveryclient_reregister": 0,
"gauge.servo.eurekaclient.registration.lastsuccessfulheartbeattimeperiod": 471,
"gauge.servo.eurekaclient.registry.lastsuccessfulregistryfetchtimeperiod": 20672,
"gauge.servo.eurekaclient.registry.localregistrysize": 1,
"gauge.servo.response.loginsuccess": 102,
"gauge.servo.eurekaclient.resolver.lastloadtimestamp": 0,
"gauge.servo.eurekaclient.resolver.endpointssize": 1,
"counter.servo.eurekaclient.transport.connectionerrors": 0,
"gauge.servo.response.dump": 387,
"gauge.servo.response.mappings": 25,
"gauge.servo.eurekaclient.registration.lastheartbeatsec_00120": 0,
"gauge.servo.response.images.kaptcha.jpg": 22,
"gauge.servo.response.invoice.invoiceinfo.tolist": 146,
"gauge.servo.response.star-star": 24,
"gauge.servo.eurekaclient.registration.lastheartbeatsec_00060": 0,
"gauge.servo.eurekaclient.registration.lastheartbeatsec_00240": 0,
"gauge.servo.response.root": 365,
"gauge.servo.response.health": 1037,
"gauge.servo.response.getloginerror": 25,
"gauge.servo.eurekaclient.registry.lastupdatesec_00480": 0,
"counter.servo.discoveryclient-httpclient_reuse": 27,
"counter.servo.discoveryclient-httpclient_createnew": 9,
"counter.servo.discoveryclient-httpclient_request": 36,
"counter.servo.discoveryclient-httpclient_release": 36,
"counter.servo.discoveryclient-httpclient_delete": 8,
"normalized.servo.discoveryclient-httpclient_requestconnectiontimer.totaltime": 0.0035334999999999997,
"normalized.servo.discoveryclient-httpclient_requestconnectiontimer.count": 0.13333333333333333,
"gauge.servo.discoveryclient-httpclient_requestconnectiontimer.min": 0.016037,
"gauge.servo.discoveryclient-httpclient_requestconnectiontimer.max": 0.050036,
"normalized.servo.discoveryclient-httpclient_createconnectiontimer.totaltime": 0.0004543833333333333,
"normalized.servo.discoveryclient-httpclient_createconnectiontimer.count": 0.03333333333333333,
"gauge.servo.discoveryclient-httpclient_createconnectiontimer.min": 0.013470999999999999,
"gauge.servo.discoveryclient-httpclient_createconnectiontimer.max": 0.013791999999999999,
"gauge.servo.connectioncount": 1,
"gauge.servo.eurekaclient.registry.lastupdatesec_00015": 1,
"gauge.servo.eurekaclient.transport.quarantinesize": 0,
"gauge.servo.response.unmapped": 270,
"gauge.servo.response.invoice.invoiceinfo.list": 335,
"gauge.servo.eurekaclient.registry.lastupdatesec_00120": 0,
"normalized.servo.eureka-connection-cleaner-time.totaltime": 0.00047041666666666667,
"normalized.servo.eureka-connection-cleaner-time.count": 0.03333333333333333,
"gauge.servo.eureka-connection-cleaner-time.min": 0.012829,
"gauge.servo.eureka-connection-cleaner-time.max": 0.015396,
"counter.servo.eureka-connection-cleaner-failure": 0,
"gauge.servo.eurekaclient.registry.lastupdatesec_00030": 0,
"httpsessions.max": -1,
"httpsessions.active": 0
}
| 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 |
spring boot actuator 简单使用的更多相关文章
- spring boot admin + spring boot actuator + erueka 微服务监控
关于spring boot actuator简单使用,请看 简单的spring boot actuator 使用,点击这里 spring boot admin 最新的正式版本是1.5.3 与 spri ...
- 朱晔和你聊Spring系列S1E7:简单好用的Spring Boot Actuator
阅读PDF版本 本文会来看一下Spring Boot Actuator提供给我们的监控端点Endpoint.健康检查Health和打点指标Metrics等所谓的Production-ready(生产环 ...
- 使用Spring Boot Actuator、Jolokia和Grafana实现准实时监控
由于最近在做监控方面的工作,因此也读了不少相关的经验分享.其中有这样一篇文章总结了一些基于Spring Boot的监控方案,因此翻译了一下,希望可以对大家有所帮助. 原文:Near real-time ...
- spring boot actuator专题
spring-boot-starter-actuator模块的实现对于实施微服务的中小团队来说,可以有效地减少监控系统在采集应用指标时的开发量.当然,它也并不是万能的,有时候我们也需要对其做一些简单的 ...
- 使用Spring Boot Actuator将指标导出到InfluxDB和Prometheus
使用Spring Boot Actuator将指标导出到InfluxDB和Prometheus Spring Boot Actuator是Spring Boot 2发布后修改最多的项目之一.它经过 ...
- Spring Boot Actuator 使用
转载于:https://www.jianshu.com/p/af9738634a21 Spring Boot 的 Actuator 提供了很多生产级的特性,比如监控和度量Spring Boot 应用程 ...
- Spring Boot Actuator监控应用
微服务的特点决定了功能模块的部署是分布式的,大部分功能模块都是运行在不同的机器上,彼此通过服务调用进行交互,前后台的业务流会经过很多个微服务的处理和传递,出现了异常如何快速定位是哪个环节出现了问题? ...
- spring Boot(十九):使用Spring Boot Actuator监控应用
spring Boot(十九):使用Spring Boot Actuator监控应用 微服务的特点决定了功能模块的部署是分布式的,大部分功能模块都是运行在不同的机器上,彼此通过服务调用进行交互,前后台 ...
- 使用Spring Boot Actuator、Jolokia和Grafana实现准实时监控--转
原文地址:http://mp.weixin.qq.com/s?__biz=MzAxODcyNjEzNQ==&mid=2247483789&idx=1&sn=ae11f04780 ...
随机推荐
- maven依赖问题
我的一个maven项目A依赖于我的另一个maven项目B,但是maven dependencies中显示的是文件.如下图: 而且项目A部署的时候,部署到tomcat容器的时候也是直接部署的B的编译后的 ...
- 使用非java代码编程
使用非JAVA代码 JAVA语言及其标准API(应用程序编程接口)应付应用程序的编写已绰绰有余.但在某些情况下,还是必须使用非JAVA编码.例如,我们有时要访问操作系统的专用特性,与特殊的硬件 ...
- SuperMap iClient for JavaScript初入
SuperMap iClient for JavaScript初入 介绍SuperMap for Js的简单使用. 推荐先看下这篇文档:SuperMap iClient for JavaScript ...
- java 重写与重载
一.方法重写: 参数列表必须完全与被重写方法的相同: 返回类型必须完全与被重写方法的返回类型相同: 访问权限不能比父类中被重写的方法的访问权限更低.例如:如果父类的一个方法被声明为public,那么在 ...
- Android Studio库依赖问题
Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'. > com.android. ...
- 面试必问的 volatile,你了解多少?
前言 Java中volatile这个热门的关键字,在面试中经常会被提及,在各种技术交流群中也经常被讨论,但似乎讨论不出一个完美的结果,带着种种疑惑,准备从JVM.C++.汇编的角度重新梳理一遍. vo ...
- awk -f program.file 功能使用
一.awk -f program.file 功能使用 一直没有使用过awk的-f功能,感觉鸡肋,不是很实用,更多的是因为没有需求的原因 下面介绍下awk -f的使用方法 awk可以指定默认的文件路径, ...
- bzoj 4562 [Haoi2016]食物链
4562: [Haoi2016]食物链 Time Limit: 10 Sec Memory Limit: 128 MB Description 如图所示为某生态系统的食物网示意图,据图回答第1小题 ...
- 面试中的Java链表
链表作为常考的面试题,并且本身比较灵活,对指针的应用较多.本文对常见的链表面试题Java实现做了整理. 链表节点定义如下: static class Node { int num; Node next ...
- python的logging模块
python提供了一个日志处理的模块,那就是logging 导入logging模块使用以下命令: import logging logging模块的用法: 1.简单的将日志打印到屏幕上 import ...