springboot集成Actuator
Actuator监控端点,主要用来监控与管理。
原生端点主要分为三大类:应用配置类、度量指标类、操作控制类。
应用配置类:获取应用程序中加载的配置、环境变量、自动化配置报告等与SpringBoot应用密切相关的配置类信息。(可以理解为静态报告)
度量指标类:获取应用程序运行过程中用于监控的度量指标。比如:内存信息、线程池信息、HTTP请求统计等。(动态报告)
操作控制类:提供了对应用的关闭操作类功能。目前只有/shutdown。
springboot集成Actuator
1.添加pom依赖(springboot:1.5.9.RELEASE)
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
2.启动项目,发现
Mapped "{[/user/getUserDue/{userId}],methods=[GET]}" onto public com.zhongxin.wealth.domain.ZxUserDueAmount com.zhongxin.wealth.web.UserController.selectUserDueByUserId(java.lang.String)
2017-12-28 15:36:59.047 INFO 14276 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/user/getUserPlan/{userId}],methods=[GET]}" onto public java.util.List<com.zhongxin.wealth.domain.ZxUserPlanAmount> com.zhongxin.wealth.web.UserController.selectUserPlanByUserId(java.lang.String)
2017-12-28 15:36:59.050 INFO 14276 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/swagger-resources/configuration/security]}" onto public org.springframework.http.ResponseEntity<springfox.documentation.swagger.web.SecurityConfiguration> springfox.documentation.swagger.web.ApiResourceController.securityConfiguration()
2017-12-28 15:36:59.054 INFO 14276 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/swagger-resources]}" onto public org.springframework.http.ResponseEntity<java.util.List<springfox.documentation.swagger.web.SwaggerResource>> springfox.documentation.swagger.web.ApiResourceController.swaggerResources()
2017-12-28 15:36:59.057 INFO 14276 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/swagger-resources/configuration/ui]}" onto public org.springframework.http.ResponseEntity<springfox.documentation.swagger.web.UiConfiguration> springfox.documentation.swagger.web.ApiResourceController.uiConfiguration()
2017-12-28 15:36:59.061 INFO 14276 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2017-12-28 15:36:59.063 INFO 14276 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2017-12-28 15:36:59.547 INFO 14276 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/logfile || /logfile.json],methods=[GET || HEAD]}" onto public void org.springframework.boot.actuate.endpoint.mvc.LogFileMvcEndpoint.invoke(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) throws javax.servlet.ServletException,java.io.IOException
2017-12-28 15:36:59.550 INFO 14276 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/env/{name:.*}],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EnvironmentMvcEndpoint.value(java.lang.String)
2017-12-28 15:36:59.551 INFO 14276 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/env || /env.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-12-28 15:36:59.552 INFO 14276 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/autoconfig || /autoconfig.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-12-28 15:36:59.554 INFO 14276 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/configprops || /configprops.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-12-28 15:36:59.555 INFO 14276 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/heapdump || /heapdump.json],methods=[GET],produces=[application/octet-stream]}" onto public void org.springframework.boot.actuate.endpoint.mvc.HeapdumpMvcEndpoint.invoke(boolean,javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse) throws java.io.IOException,javax.servlet.ServletException
2017-12-28 15:36:59.560 INFO 14276 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/mappings || /mappings.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-12-28 15:36:59.561 INFO 14276 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/info || /info.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-12-28 15:36:59.564 INFO 14276 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/loggers/{name:.*}],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.LoggersMvcEndpoint.get(java.lang.String)
2017-12-28 15:36:59.565 INFO 14276 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/loggers/{name:.*}],methods=[POST],consumes=[application/vnd.spring-boot.actuator.v1+json || application/json],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.LoggersMvcEndpoint.set(java.lang.String,java.util.Map<java.lang.String, java.lang.String>)
2017-12-28 15:36:59.566 INFO 14276 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/loggers || /loggers.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-12-28 15:36:59.569 INFO 14276 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/metrics/{name:.*}],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.MetricsMvcEndpoint.value(java.lang.String)
2017-12-28 15:36:59.569 INFO 14276 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/metrics || /metrics.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-12-28 15:36:59.572 INFO 14276 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/auditevents || /auditevents.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public org.springframework.http.ResponseEntity<?> org.springframework.boot.actuate.endpoint.mvc.AuditEventsMvcEndpoint.findByPrincipalAndAfterAndType(java.lang.String,java.util.Date,java.lang.String)
2017-12-28 15:36:59.574 INFO 14276 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/trace || /trace.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-12-28 15:36:59.576 INFO 14276 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/dump || /dump.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-12-28 15:36:59.577 INFO 14276 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/beans || /beans.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()
2017-12-28 15:36:59.581 INFO 14276 --- [ main] o.s.b.a.e.mvc.EndpointHandlerMapping : Mapped "{[/health || /health.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v1+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.HealthMvcEndpoint.invoke(javax.servlet.http.HttpServletRequest,java.security.Principal)
3.访问:http://127.0.0.1:8888/对应的指标 记录进行查看
4.如果springboot是1.5之前应该能直接进行访问,如果是1.5之后,会提示:
Full authentication is required to access actuator endpoints. Consider adding Spring Security or set 'management.security.enabled' to false.
这是因为1.5之后添加了安全机制
你可以很粗暴的关闭验证
management.security.enabled=false
当然正常情况下是不允许的,那么就需要进行安全验证
添加pom依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
配置用户名密码
security.user.name=nicai
security.user.password=bugaosuni
访问浏览器输入用户名密码,即可进行访问。
springboot集成Actuator的更多相关文章
- SpringBoot集成actuator模块的基本使用
© 版权声明:本文为博主原创文章,转载请注明出处 1. 版本 SpringBoot:2.0.0.RELEASE 2. 集成 SpringBoot集成actuator模块非常简单,只需要引入actuat ...
- SpringBoot集成Actuator监控管理
1.说明 本文详细介绍Spring Boot集成Actuator监控管理的方法, 基于已经创建好的Spring Boot工程, 然后引入Actuator依赖, 介绍监控管理相关功能的使用. Sprin ...
- SpringBoot集成Actuator端点配置
1.说明 Actuator端点可以监控应用程序并与之交互. Spring Boot包括许多内置的端点, 比如health端点提供基本的应用程序运行状况信息, 并允许添加自定义端点. 可以控制每个单独的 ...
- SpringBoot集成Actuator健康指示器health
1.说明 本文详细介绍Actuator提供的HealthIndicators, 即健康指示器的配置使用, 利用自动配置的健康指标, 检查正在运行的应用程序的状态, 以及自定义健康指标的方法. 监控软件 ...
- SpringBoot系列: Actuator监控
Sprng Boot 2 actuator变动加大, 网上很多资料都都已经过期. ============================配置项============================ ...
- SpringBoot之actuator
在springBoot中集成actuator可以很方便的管理和监控应用的状态. 暴露的Restful接口有: HTTP方法 路径 描述 鉴权 GET /autoconfig 查看自动配置的使用情况 t ...
- 0120 springboot集成Mybatis和代码生成器
在日常开发中,数据持久技术使用的架子使用频率最高的有3个,即spring-jdbc , spring-jpa, spring-mybatis.详情可以看我之前的一篇文章spring操作数据库的3个架子 ...
- 【springBoot】springBoot集成redis的key,value序列化的相关问题
使用的是maven工程 springBoot集成redis默认使用的是注解,在官方文档中只需要2步; 1.在pom文件中引入即可 <dependency> <groupId>o ...
- SpringBoot集成security
本文就SpringBoot集成Security的使用步骤做出解释说明.
随机推荐
- C#之文件缓存
写在开头 今天就放假了,照理说应该写今年的总结了,但是回头一看,很久没有写过技术类的文字了,还是先不吐槽了. 关于文件缓存 写了很多的代码,常常在写EXE(定时任务)或者写小站点(数据的使用和客户端调 ...
- ES6,Array.includes()函数的用法
在ES5,Array已经提供了indexOf用来查找某个元素的位置,如果不存在就返回-1,但是这个函数在判断数组是否包含某个元素时有两个小不足,第一个是它会返回-1和元素的位置来表示是否包含,在定位方 ...
- ACE在windows下的编译及配置(VS2010)
ACE在windows下的编译及配置(VS2010) 分类: -[小西南]- 2013-08-06 16:17 2354人阅读 评论( ...
- Linux-安装FFmpeg
FFmpeg官网:http://www.ffmpeg.org 官网介绍 FFmpeg is the leading multimedia framework, able to decode, enco ...
- 《Discuz安装时候出现乱码 -- 问题解决方法》
自我安装discuz时出现安装界面乱码的情况,跟链接所说一样,经过原作的分享,加上我自己的实验,明白了,什么时候修改/usr/local/php/etc/php.ini里面的default_chars ...
- win7局域网共享文件
调整共享文件所在电脑设置: 1. 关闭防火墙 2. 更改网络设置 ①打开网络和共享中心 ②进入"选择家庭组和共享选项" ③进入"更改高级共享设置" ④调整设置并 ...
- 对html语义化的理解
所有人都知道html即超文本标记语言或超文本链接标示语言,是目前网络上应用最为广泛的语言,也是构成网页文档的主要语言. html标签中的大部分都是由"语义化"标签所担任 那么,它有 ...
- python多版本以及各种包管理
python多版本以及各种包管理 python 包管理 各个版本 python版本管理 由于Python有2.x和3.x两个大的版本,而且每一个工程建立所用的各种包的版本也不尽相同(如flask1.x ...
- mac 上格式化磁盘出现MediaKit报告设备上的空间不足以执行请求的解决办法
1.问题描述: 我使用是一个2T移动硬盘,分了5个区 2.分析原因:因为mac OSX的日志式格式需要有EFI分区进行引导,而我的移动硬盘是没有EFI分区的,这样的话就会出现问题: 3.解决办法: 1 ...
- Yii如何使用数据库
1.Yii如何使用数据库 Yii通过数据库访问对象(Database Access Objects,简称DAO)来使用数据库的. DAO建立在"PHP数据对象(PDO)之上,并提供一套面向对 ...