编程知识 cdmana.com

Implementation of health monitoring in 10 springboot project

10-SpringBoot Realization of project health monitoring

springboot

Health monitoring brief

Spring Boot in actuator Module provides health check , Audit 、 Index collection ,HTTP Tracking and other functions , Can help us better manage and track springboot project .

Health monitoring configuration implementation

In projects that need to use health monitoring or module in , Add the following dependencies :

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

After adding dependencies ,reload Item or module.

Health monitoring starts analysis

Start project , Enter the following address in the browser :(SpringBoot Limited options for monitoring by default )

http://localhost/actuator

The results of the visit , As shown in the figure :

image.png

You can also do it in actuator Click on the list of choices , For example, to access health

http://localhost/actuator/health

The result is , As shown in the figure ( among up State means normal ):
image.png

If you want to see more actuator Options , Can be in spring boot Configuration file

application.properties Add the following statement to :

management.endpoints.web.exposure.include=*

then , Restart the server , Based on access http://localhost/actuator Address ...)

summary (Summary)

This section is mainly about springboot The health monitoring function in the project is analyzed and realized simply , You can be based on the needs of your business , Monitoring configuration and analysis .

版权声明
本文为[Zhong Kai]所创,转载请带上原文链接,感谢

Scroll to Top