首页 > 解决方案 > 如何在 Spring Boot 执行器中实现自定义端点以健康

问题描述

我将如何在 SpringBoot 中实现自定义端点以实现以下目标:

http://localhost:8080/actuator/health/custom

其中“自定义”是我想要实现的扩展健康的端点。

标签: javaendpointspring-boot-actuatorhealth-monitoring

解决方案


该 url 用于公开应用程序的健康检查,如果这是您的情况,您只需要包含执行器的依赖项:

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

你可以看到应用程序的状态。

如果您需要更具体的内容,只需配置依赖项,如您在此处看到的那样。

您也可以覆盖健康检查的行为,但该依赖项具有很多功能。


推荐阅读