The Actuator may be familiar. It uses Springboot to monitor applications and view their configurations. The implementation of spring-boot-starter-actuator module can effectively reduce the development amount of monitoring system in collecting application indicators for small and medium-sized teams implementing micro-services. Of course, it is not a panacea, sometimes we also need to do some simple extensions to help us achieve our own system personalized monitoring requirements. Following, in this paper, we will introduce some contents about spring-boot-starter- Actuator module in detail, including its native endpoints and some common expansion and configuration methods.

V Add reference

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

View logs:

In Spring Boot 2.0, we found that only the Health and Info endpoints were exposed, and the rest were not open at all. IO /spring-boot…

Update the application. The properties management endpoints. Web. Exposure. Include = *

View the log after updating application.properties:

Run after the project, visit http://localhost:8080/actuator, all the relevant information that can see.

V More Introduction

Describes the features of the Actuator exposed in the red frame:

HTTP method The path describe authentication
GET /autoconfig View the usage of automatic configuration true
GET /configprops View configuration properties, including default configurations true
GET /beans View a list of beans and their relationships true
GET /dump Print thread stack true
GET /env View all environment variables true
GET /env/{name} View specific variable values true
GET /health View application health indicators false
GET /info Viewing Application Information false
GET /mappings View all URL mappings true
GET /metrics View basic application indicators true
GET /metrics/{name} Viewing Specific Indicators true
POST /shutdown Close the application true
GET /trace View basic tracking information true

V Source code address

Github.com/toutouge/ja…

About the author: Focus on basic platform project development. If you have any questions or suggestions, please feel free to comment! Copyright notice: The copyright of this article belongs to the author and the blog garden, welcome to reprint, but without the consent of the author must retain this statement, and give the original text link in a prominent place on the page of the article. For the record: all comments and messages will be answered as soon as possible. You are welcome to correct your mistakes and make progress together. Or direct private message I support the blogger: if you think the article is helpful to you, you can click on the lower right corner of the article [recommendation]. Your encouragement is the author to adhere to the original and continuous writing of the biggest power! \