I. Introduction
Actuator (motivator; actuator) is a straight module Spring Boot provided for monitoring the project. Which realize different monitoring functions through different monitoring terminal. Its function is similar to the monitoring center of Dubbo, the difference is, the monitoring center of Dubbo is the need for specialized deployments, and the Actuator Spring Boot is present in every project.
Second, the dependence
Just a Spring Boot project can be monitored using the Actuator.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
Third, the configuration
#-----------------------------------Actuator监控器------------------------------------
# Actuator监控端口与控制中心,默认只开启info、与health监控
# http://localhost:9999/actuator/beans
management:
server:
port: 9999 #设置Actuator监控端口
endpoints:
web:
exposure:
include: '*' #打开Actuator所有监控
#exclude: ['env','beans']
base-path: /actuator #设置Actuator监控基本路径
#-----------------------------------INFO------------------------------------
#自定义INFO信息
#浏览器访问 http://localhost:9999/actuator/info
info:
company:
name: '公司名称'
url: 'www.xxxx'
addr: 'china'
Fourth, test access
1, beans terminal
http://localhost:9999/actuator/beans
2、env
http://localhost:9999/actuator/env
3, custom information
Fifth, the common monitoring terminal
In the Baidu search "springboot actuator" can be found on the following table
HTTP method | Monitoring terminal | Functional Description |
GET | /autoconfig | Automatic configuration provides a report, which recorded automatically configured by the conditions, which did not pass |
GET | /configprops | Description configuration properties (including default) how to inject Bean |
GET | /beans | Description of the application in the context of all of the Bean, as well as their relationship |
GET | /dump | Take a snapshot of the thread activity |
GET | /env | Get all environmental attributes |
GET | /env/{name} | Obtain specific environmental attribute value by name |
GET | /health | Health indicators reporting application, these values are provided by HealthIndicator implementation class |
GET | /info | Gets the application of customized information, the information provided by the attribute starts with info |
GET | /mappings | Description of all the URI path, and a controller as well as their (Actuator comprising endpoint) mapping relationship |
GET | /metrics | Metric information reporting various applications, such as HTTP requests and memory usage count |
GET | /metrics/{name} | Reports specify the application of the measure name |
POST | /shutdown | Close the application, is set to true in claim endpoints.shutdown.enabled |
GET | /trace | Providing basic HTTP request tracking information (timestamp, HTTP class) |