简体   繁体   中英

How to implement custom endpoint in Spring Boot actuator to health

How would I implement a custom endpoint in SpringBoot to achieve the following:

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 :

<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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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