Spring boot uses admin to monitor applications

The monitoring interfaces provided by spring boot, such as: / health, / info, etc. in fact, in addition to the previously mentioned information, there are other information industries that need to be monitored: the number of active sessions, the number of concurrent applications, latency, and other measurement information. Let's learn how to use spring boot admin to monitor our system.

1、 Create spring boot admin service

First, use the spring tool suite (STS) to create a simple admin project:

New > spring starter project, fill in the following steps to complete the project step by step:

Open POM. Under the project XML file, add content:

Add the annotation "@ enableadminserver" on the springbootadminwebapplication

In application Add content to properties:

Run the app and enter in the browser: http://localhost:8090/ As shown in the figure below, it indicates success.

2、 Add other items to be monitored

We found a spring boot project that we needed to monitor

Open POM XML, add dependency:

Then in application Add in properties:

At this point, start the spring boot project to be monitored, and then access the admin project address above in the browser http://localhost:8090/

You can see the results shown in the figure below, indicating that it has been added to the management. Click detail to view its details.

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>