From the course: Advanced Spring: Spring Boot Actuator
Introduction to Spring Boot Actuator - Spring Boot Tutorial
From the course: Advanced Spring: Spring Boot Actuator
Introduction to Spring Boot Actuator
- [Instructor] Spring Boot Actuator is a module that helps us in monitoring and managing our Spring Boot application when we push them to production. It adds many production grade services to applications with little effort on our part, and allows us to monitor our applications in two different ways, either by leveraging HTTP endpoints or via leveraging JMX. JMX stands for Java Management Extension. Throughout this course, we'll be leveraging the HTTP endpoints. Spring Boot Actuator, also, integrates easily with external monitoring systems, such as Prometheus, Datadog, New Relic, and so much more. It does so by leveraging Micrometer, which is a vendor neutral application metric facade, that makes it easier to plug into these monitoring systems. We'll be integrating our application with Prometheus and building a beautiful dashboard with Grafana later on in this course. I've also provided a repo for an existing application that we'll monitor throughout this course. It's a basic cloud application. Let's take a look at it by going over to IntelliJ. As you can see, right here I'm in my service layer, and I just have some business logic here. And if I go into my controller, you see endpoints that talk to the disservice layer. And you see endpoints for posting, getting, putting, deleting. If I also take a look at my application to properties file, I have an in-memory database. I'm using H2. And when I ran the application, it's just running on port 8080. And as you can see, I have H2 for my path for my database. What's missing, however, is that I don't have a way to monitor this right now. So, in order for me to monitor this with spring boot actuator, I'm going to go over into my palm.xml file and bring in additional dependency, which would be for spring boot actuator. So, let's do that right away. So I'm coming here, and I'm going to type in dependency. Let IntelliJ complete that for me. I'm going to grab the group ID from here and paste it down here, because it's going to be the same. I'm also going to need all of this part, spring boot starter. However, the dependency that I need to bring in is actuator. So, I'm going to type that in, actuator. Make sure you spell that correctly, and allow it to load. Once it loads, we're going to restart the application. So, I'm going to do that right now. And once the application is up and running, I should have a new path, a base path for actuator. And if that's the case, we're going to trigger that endpoint and see what we get, okay? So, I'm going to scroll over. And as you can see, we have a new base path to monitor our application. So, let's go over to Postman, and let's trigger this endpoint by typing in http://localhost:8080/actuator, okay? And let's hit send. And awesome. We did get back a JSON response with the actuator base path. And it shows you we have a couple of endpoints here, one for health. We'll take a look at these later in the course. So, a great job for getting this far. This is awesome.
Contents
-
-
-
Introduction to Spring Boot Actuator3m 10s
-
(Locked)
Actuator endpoints and documentation2m 12s
-
(Locked)
Exposing and enabling endpoints5m 25s
-
(Locked)
Show details and create health endpoint groups4m 4s
-
(Locked)
Show application information with the info endpoint4m 10s
-
(Locked)
Overriding the Actuator base path4m 36s
-
-
-
-
-