简体   繁体   English

如何在Spring Boot执行器中实现自定义终结点以保持健康

[英]How to implement custom endpoint in Spring Boot actuator to health

How would I implement a custom endpoint in SpringBoot to achieve the following: 我如何在SpringBoot中实现自定义端点来实现以下目的:

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

where "custom" is the endpoint I want to implement that extends health. 其中“自定义”是我要实现的扩展健康的端点。

That url is used to expose the Health checks for the application, if that is your situation, you only need to include the dependencies for the actuator : 该URL用于公开应用程序的运行状况检查,如果您遇到这种情况,则只需包括执行器的依赖项:

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

and you can see the status of the app. 您可以看到该应用的状态。

If you need something more specific, only configure the dependency as you can see here . 如果您需要更具体的内容,请仅配置依赖项,如此处所示。

Also you can override the behavior of the healthchecks but that dependency have a lot of functionality. 您也可以覆盖运行状况检查的行为,但是该依赖项具有很多功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM