启用生产就绪功能

spring-boot-actuator 模块提供了所有 Spring Boot 的生产就绪功能。 启用这些功能的推荐方式是添加 spring-boot-starter-actuator starter 依赖。

Actuator 的定义

Actuator 是一个制造术语,指的是用于移动或控制某物的机械装置。 Actuator 可以从小的变化产生大量的运动。

要在基于 Maven 的项目中添加 actuator,添加以下 starter 依赖:

<dependencies>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-actuator</artifactId>
	</dependency>
</dependencies>

对于 Gradle,使用以下声明:

dependencies {
	implementation 'org.springframework.boot:spring-boot-starter-actuator'
}