springboot 监控
一、什么是spring-boot-starter-actuator(doc)
springboot项目如何检查配置与运行状态呢?官方提供了一些接口可以查看springboot项目运行情况,只需要导入spring-boot-starter-actuator,项目集成:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
二、监控api

几个api示例:
/autoconfig : 查看自动配置

/beans : 查看beans

为了安全起见,可以单独设置监控的端口和访问地址:
management.port=9000 # 通过9000端口访问
management.address=127.0.0.1 # 只允许本机访问
/shotdown : 关闭
打开shutdown功能:
endpoints:
shutdown:
enabled: true #启用shutdown
sensitive: false #禁用密码验证

执行完毕,启动的项目已被终止了。
安全设置,设置账号密码,只有拥有账号密码的才能shutdown
1、引用security
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
2、开启安全验证
endpoints:
shutdown:
enabled: true #启用shutdown
sensitive: true #开启shutdown的安全验证
path: /testshutdown #指定shutdown endpoint的路径 management:
port: 9000 #指定管理端口
address: 127.0.0.1 #指定管理IP
security:
role: SUPERUSER #角色 security:
user:
name: admin #验证用户名
password: 123 #验证密码
3、postman请求shutdown

springboot 监控的更多相关文章
- springboot 监控 Actuator
springboot 提供了对项目的监控功能. 1.首先添加依赖包 <!-- https://mvnrepository.com/artifact/org.springframework.boo ...
- Springboot监控之二:Spring Boot Admin对Springboot服务进行监控
概述 Spring Boot 监控核心是 spring-boot-starter-actuator 依赖,增加依赖后, Spring Boot 会默认配置一些通用的监控,比如 jvm 监控.类加载.健 ...
- springboot监控
springboot版本 <parent> <groupId>org.springframework.boot</groupId> <artifactId&g ...
- Springboot监控之一:SpringBoot四大神器之Actuator之3-springBoot的监控和管理--指标说明
Spring Boot包含很多其他的特性,它们可以帮你监控和管理发布到生产环境的应用.你可以选择使用HTTP端点,JMX或远程shell(SSH或Telnet)来管理和监控应用.审计(Auditing ...
- Springboot监控之一:SpringBoot四大神器之Actuator
介绍 Spring Boot有四大神器,分别是auto-configuration.starters.cli.actuator,本文主要讲actuator.actuator是spring boot提供 ...
- Grafana+Prometheus打造springboot监控平台
1. 环境 springboot 1.5.10.RELEASE Grafana 5.4.2 Prometheus 2.6.0 jdk 1.8 2.通过micrometer与springboot应用和p ...
- SpringBoot 监控管理模块actuator没有权限的问题
SpringBoot 1.5.9 版本加入actuator依赖后, 访问/beans 等敏感的信息时候报错,如下 Tue Mar 07 21:18:57 GMT+08:00 2017 There wa ...
- Springboot监控之一:SpringBoot四大神器之Actuator之2--springboot健康检查
Health 信息是从 ApplicationContext 中所有的 HealthIndicator 的 Bean 中收集的, Spring Boot 内置了一些 HealthIndicator. ...
- Springboot监控之一:SpringBoot四大神器之Actuator之2--覆盖修改spring cloud的默认的consul健康检查规则
微服务网关是socket长连接与支付公司对接,该网关需要提供http接口给内部系统调用,当socket没有建立连接时(网关服务的高可用是haProxy搭建的,有些服务的socket可能未连上支付公司) ...
随机推荐
- php事件钩子
PHP中钩子函数的实现与认识: http://rmingwang.com/set-php-hooks.html 1.钩子函数是预设并在特定的条件下触发的. 2.钩子函数接管程序后可以影响到程序的走向 ...
- WebAPI学习日记一:Ajax请求传递参数遇到的问题
首先,本人大学刚毕业,想把自己学习的一些东西记录下来,也是和大家分享,如有不对之处还请多加指正.声明:但凡是我博客里的文章均是本人实际操作遇到的例子,不会随便从网上拷贝或者转载,本着对自己和观众负责的 ...
- 【BZOJ3195】[Jxoi2012]奇怪的道路 状压DP
[BZOJ3195][Jxoi2012]奇怪的道路 Description 小宇从历史书上了解到一个古老的文明.这个文明在各个方面高度发达,交通方面也不例外.考古学家已经知道,这个文明在全盛时期有n座 ...
- 重启svn
重启svn svnserve -d -r /svn -d表示后台运行 -r 指定根目录是 /u02/svn
- mysql如何用sql添加字段如何设置字符集和排序规则
alter table pay_company add sms_code2 varchar(16) CHARACTER SET UTF8 COLLATE utf8_general_ci DEFAULT ...
- iermu爱耳目
百度推出720P 云直播摄像头 查看直播请点击 直播 互联网网盘新动向实现初见端倪,之前写过一篇关于互联网网盘的思考. 我只是仅仅有想法而已,百度已经实现了一部分. 具体功能参见http://www. ...
- 关于微信小程序的场景值
微信小程序 “场景值” 对运营同学和产品比较有用一般开发者需在这里埋点,获取场景址,看一下小程序,用户一般从哪个路口进的有利于提升产品体验
- If a cache file exists, it is sent directly to the browser, bypassing the normal system execution.
w开启缓存,缓存视图,用于后续请求. https://www.codeigniter.com/userguide3/overview/appflow.html http://codeigniter.o ...
- zipline目录结构
下面列出了zipline主要的目录和文件结构和它的说明 ├── ci - 持续集成相关 ├── conda - 生成conda 包相关 ├── docs - 文档 │ ├── notebooks - ...
- 并发编程 - 进程 - 1.队列的使用/2.生产者消费者模型/3.JoinableQueue
1.队列的使用: 队列引用的前提: 多个进程对同一块共享数据的修改:要从硬盘读文件,慢,还要考虑上锁: 所以就出现了 队列 和 管道 都在内存中(快): 队列 = 管道 + 上锁 用队列的目的: 进程 ...