How to Monitor, Audit and Gather Metrics on a Spring Boot Application

This time we will discuss how we can monitor, audit and gather metrics on a spring boot application. When dealing with a multi-component app...



This time we will discuss how we can monitor, audit and gather metrics on a spring boot application.

When dealing with a multi-component application such as in a microservice architecture it is very important to manage, audit, gather metrics, health check-up and monitor the different micro-service applications or in our example Spring boot applications. With Spring boot framework there is a library that is easily accessible and configured to provide such production-ready features which are the Spring Boot Actuator. These features are accessible via JMX or HTTP endpoints.

In addition, there is also a community project which is known as Spring Admin that provides an administration that provides a centralized place to access the details submitted by all the registered clients.

In this blog, we will set up the Spring Admin server and a sample client.

Setup the Spring Admin Server

  1. Using the Sprint STS development environment, create a Spring starter project. Add the following dependencies:
    1. spring-boot-starter-web
    2. spring-boot-admin-starter-server
    3. spring-boot-admin-starter-client
    4. spring-boot-starter-security
    5. spring-boot-devtools
  2. After the project is created, add the spring-boot-maven-plugin in your pom.xml with goal=build-info.
  3. Configure application.properties. See file below for description.
  4. Annotate your Spring boot class with @EnableAdminServer.
  5. Create a security configuration class. See class below.

Setup the Client

If you will notice the server project contains an admin starter client dependency as well as configuration to connect to itself. It means that we are setting up the server as a client itself.

Here are the steps to set up a client.
  1. Add spring-boot-admin-starter-client dependency.
  2. Add the credentials to connect to the admin server in the application.json file. See file below.

References

COMMENTS

mas template
Name

amazon,1,angular,8,bigdata,2,business,1,course-spring,27,courses,6,database,4,docker,3,java,50,kafka,1,keycloak,4,microservices,5,mysql,1,neworking,1,nosql,2,php,1,pinned,2,react,3,server management,7,shared drive,1,spring,7,synology,1,troubleshooting,2,web,1,wordpress,1,
ltr
item
toztech: How to Monitor, Audit and Gather Metrics on a Spring Boot Application
How to Monitor, Audit and Gather Metrics on a Spring Boot Application
https://i.ytimg.com/vi/pXzE5pkF160/0.jpg
https://i.ytimg.com/vi/pXzE5pkF160/0.jpg
toztech
https://toztech.blogspot.com/2019/08/how-to-monitor-audit-and-gather-metrics.html
https://toztech.blogspot.com/
https://toztech.blogspot.com/
https://toztech.blogspot.com/2019/08/how-to-monitor-audit-and-gather-metrics.html
true
2554149350007112447
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content