为项目整合Spring Boot Acuator
来源:互联网 发布:js怎么隐藏标签 编辑:程序博客网 时间:2024/05/21 17:22
- 了解Acuator
Spring Boot Acuator 提供了很多控制端点。从而了解应用程序的状况。 - Acuator监控端点及描述
端点描述Http方法autoconfig显示自动配置信息GETbeans显示应用程序所有上下文Spring beanGETconfigprops显示所有configurationProperties配置属性列表GETdump显示线程活动快照GETevn显示应用的环境变量GEThealth显示应用的程序的健康指标,这些由healthIndicator的实现类提供GETinfo显示应用信息,可以用info*属性自定义info端点公开数据GETmappings显示所有的url路径GETmetrics显示应用的度量标准信息GETshutdown关闭应用GETtrace显示跟踪信息(默认是100http请求GET - 为项目添加依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
测试:访问 http://127.0.0.1:8080/health
结果:
{"status":"UP"} ,返回的是UP表示正常访问http://127.0.0.1:8080/info 结果:{}证明info没有公开
结果:{}证明info没有公开
配置application.ymlinfo: app: name: "@project.name@" description: "@project.description@" version: "@project.version@" spring-boot-version: "@project.parent.version@" 再次访问 http://localhost:8080/info结果:{"app":{"name":"microservice-simple-provider-user","description":"zjmdemo","version":"0.0.1-SNAPSHOT","spring-boot-version":"1.5.9.RELEASE"}}访问:http://127.0.0.1:8080/autoconfigWhitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Thu Dec 21 21:54:04 CST 2017There was an unexpected error (type=Unauthorized, status=401).Full authentication is required to access this resource.上面的是没有开启授权在application.yml加上management: security: enabled: false就可以访问了http://127.0.0.1:8080/autoconfig 和其他未授权的都能访问了
Spring Boot Acuator 提供了很多控制端点。从而了解应用程序的状况。
端点描述Http方法autoconfig显示自动配置信息GETbeans显示应用程序所有上下文Spring beanGETconfigprops显示所有configurationProperties配置属性列表GETdump显示线程活动快照GETevn显示应用的环境变量GEThealth显示应用的程序的健康指标,这些由healthIndicator的实现类提供GETinfo显示应用信息,可以用info*属性自定义info端点公开数据GETmappings显示所有的url路径GETmetrics显示应用的度量标准信息GETshutdown关闭应用GETtrace显示跟踪信息(默认是100http请求GET
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
测试:访问 http://127.0.0.1:8080/health
结果:
{"status":"UP"} ,返回的是UP表示正常访问http://127.0.0.1:8080/info 结果:{}证明info没有公开结果:{}证明info没有公开
配置application.ymlinfo: app: name: "@project.name@" description: "@project.description@" version: "@project.version@" spring-boot-version: "@project.parent.version@"再次访问 http://localhost:8080/info结果:{"app":{"name":"microservice-simple-provider-user","description":"zjmdemo","version":"0.0.1-SNAPSHOT","spring-boot-version":"1.5.9.RELEASE"}}访问:http://127.0.0.1:8080/autoconfigWhitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Thu Dec 21 21:54:04 CST 2017There was an unexpected error (type=Unauthorized, status=401).Full authentication is required to access this resource.上面的是没有开启授权在application.yml加上management: security: enabled: false就可以访问了http://127.0.0.1:8080/autoconfig 和其他未授权的都能访问了
阅读全文
0 0
- 为项目整合Spring Boot Acuator
- Spring Boot整合Swagger框架示例项目。
- Spring boot项目整合thymeleaf和shiro
- 将已有项目改造为Spring Boot项目
- Spring-Boot项目+Spring-Mybatis+分页插件+Spring单元测试整合
- Web项目切换为Spring-boot部署
- maven项目 spring-boot 整合 mybatis 实现查询功能demo
- spring boot项目整合activiti后,打开页面需要验证
- 使用spring boot搭建与dubbo整合项目
- spring boot 整合Freemarker
- Spring Boot整合MyBatis
- spring-boot整合kindeditor
- spring boot 整合mybatis
- Spring Boot整合MyBatis
- Spring-boot整合Mybatis
- spring boot ehcache整合
- Spring Boot整合MyBatis
- spring boot 整合 CAS
- 正则化方法:防止过拟合,提高泛化能力
- poj日记(2632)
- MyBatis框架配置与使用1
- C语言等待一秒,延时函数sleep()
- 【计算方法笔记】python四阶Runge-Kutta法
- 为项目整合Spring Boot Acuator
- poj2505:A multiplication game(Hash)
- 9. java.util.Collections
- 在ROS中使用中文语音交互(百度语音baidu_speech)
- Okhttp2同步,异步 get,post
- Effective TensorFlow Chapter 9: TensorFlow模型原型的设计和利用python ops的高级可视化
- android中getWidth()和getMeasuredWidth()之间的区别
- 数据挖掘学习------------------4-分类方法-7-支持向量机(SVM)
- UE 通用小功能代码集合《一》