首先项目中引入SpringBoot起步Starter
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
启动项目
/info 代码里自定义信息
/health 健康检查 组件的状态检查
// 20180316134559
// http://localhost:8033/health
{
"description": "Composite Discovery Client",
"status": "UP",
"discoveryComposite": {
"description": "Composite Discovery Client",
"status": "UP",
"discoveryClient": {
"description": "Composite Discovery Client",
"status": "UP",
"services": [
"web"
]
},
"eureka": {
"description": "Remote status from Eureka server",
"status": "UP",
"applications": {
"WEB": 1
}
}
},
"diskSpace": {
"status": "UP",
"total": 500068036608,
"free": 335228104704,
"threshold": 10485760
},
"hystrix": {
"status": "UP"
}
}
/beans 目前Spring容器中所有的Bean
代码片段
[
{
"context": "web:dev:8033",
"parent": "bootstrap",
"beans": [
{
"bean": "webApplication",
"aliases": [
],
"scope": "singleton",
"type": "com.onion.web.WebApplication$$EnhancerBySpringCGLIB$$7c6083f5",
"resource": "null",
"dependencies": [
]
}
]
/autoconfig Spring中所有的自动配置
/dump 运行状态
/configprops 自动配置属性
这里放出我的自定义starter的自动配置属性
"spring.retrofit-com.onion.retrofit.retrofit.RetrofitProperties": {
"prefix": "spring.retrofit",
"properties": {
"baseUrl": "https://uhuishou.ronghezulin.com/loan-app/",
"converterFactory": null
}
}
/env 环境属性
/mappings URL映射情况
{
"/webjars/**": {
"bean": "resourceHandlerMapping"
},
"/**": {
"bean": "resourceHandlerMapping"
},
"/**/favicon.ico": {
"bean": "faviconHandlerMapping"
},
"{[/web/get],methods=[GET]}": {
"bean": "requestMappingHandlerMapping",
"method": "public java.lang.String com.onion.web.controller.UserController.get() throws java.io.IOException"
},
"{[/web/register],methods=[POST]}": {
"bean": "requestMappingHandlerMapping",
"method": "public com.onion.pojo.HttpWrapper<com.onion.pojo.user.User> com.onion.web.controller.UserController.register(com.onion.pojo.user.User,java.lang.String,java.lang.String)"
},
"{[/web/getName],methods=[GET]}": {
"bean": "requestMappingHandlerMapping",
"method": "public java.lang.String com.onion.web.controller.UserController.getName()"
},
"{[/web/getCode],methods=[POST]}": {
"bean": "requestMappingHandlerMapping",
"method": "public com.onion.pojo.HttpWrapper<com.onion.pojo.user.PhoneAuthCode> com.onion.web.controller.UserController.getCode(java.lang.String)"
}
}
/metrics 系统情况
/trace 最近的请求快照
"timestamp": 1521180028385,
"info": {
"method": "GET",
"path": "/metrics",
"headers": {
"request": {
"host": "localhost:8033",
"connection": "keep-alive",
"upgrade-insecure-requests": "1",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.146 Safari/537.36",
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"accept-encoding": "gzip, deflate, br",
"accept-language": "zh-CN,zh;q=0.9,en;q=0.8",
"cookie": "Idea-b0eba593=fa7e84f1-89e8-4379-a169-24808d318d91; JSESSIONID=1F7D955EC9B2BD0DCECC33E7A40D6775"
},
"response": {
"X-Content-Type-Options": "nosniff",
"X-XSS-Protection": "1; mode=block",
"Cache-Control": "no-cache, no-store, max-age=0, must-revalidate",
"Pragma": "no-cache",
"Expires": "0",
"X-Frame-Options": "DENY",
"Strict-Transport-Security": "max-age=31536000 ; includeSubDomains",
"X-Application-Context": "web:dev:8033",
"Content-Type": "application/vnd.spring-boot.actuator.v1+json;charset=UTF-8",
"Transfer-Encoding": "chunked",
"Date": "Fri, 16 Mar 2018 06:00:28 GMT",
"status": "200"
}
},
"timeTaken": "14"
}
}