I watched a video where explained the actuators in spring boot like that "Instructor: In this video,

we'll cover the Spring Boot Actuator.

So, here's the problem.

You may have the question,

how can I monitor and manage my application?

Also, how can I check the application status?

And finally, how can I access some application metrics?

Well, one solution here is by making use

of the Spring Boot Actuator.

So, the Spring Boot Actuator actually exposes endpoints

for you to monitor and manage your application.

So, you easily get the DevOps functionality out-of-the-box.

You simply add the dependency to your Maven POM file,

and then these REST endpoints are automatically added

to your application.

So, the nice thing about it is that there's no need

to write additional code, you get these new REST endpoints

for free, and I like free stuff.

So this is pretty cool.

Now, adding a dependency to the Maven POM file,

we simply give a reference here,

and we say spring-boot-starter-actuator.

And that'll basically give us support for these metrics

and monitoring of our given application.

Now remember, Spring Boot Actuator automatically exposes

endpoints for metrics out-of-the-box.

All of the endpoints are prefixed with /actuator.

Now, here are some of the endpoints that we can make use of.

So, we have /health.

This gives you health information about your application,

and there's some other endpoints that I'll talk about

in a bit.

And just remember, you get these new REST endpoints

for free, so again, there's no additional coding

you have to do, you simply add that item

to the actual Maven dependency for Spring Boot Actuator,

and you're ready to go.

So, now let's go ahead and start by taking a look

at the health endpoint.

So, the health endpoint, or /health,

checks the status of your application.

This is normally used by monitoring apps

to see if your application is up or down.

So, here's a little screenshot of our given application,

/actuator/health.

Right now the status is up.

Now, this health status is customizable,

so you can actually customize this

based on your own custom business logic.

Now, by default, only /health is exposed.

The /info endpoint can provide more information

about your application, you can actually customize it.

Now, to expose /info, you need to make an update

in the application.properties file.

For this property here,

management.endpoints.web.exposure.include

equals health,info.

We're simply giving a comma-delimited list

of endpoints to expose.

Also, we'll set the property here

for management.info.env.enabled equals true.

And once we set these two items up,

then this will expose the /info endpoint.

Now, let's take a look at the info endpoint.

So, /info gives you information about your application.

So, the default is that it's actually empty.

So, if you access this endpoint,

you'll get this empty JSON object, which is nothing.

You're like, huh, that's not too useful.

So, we actually need to customize this info endpoint,

and we can do that by updating the application properties

with our given information.

So, we simply add in some properties here

for info.app.name, app.description, and app.version.

And that's our actual info for our given /info endpoint.

Now, anything starting with info. as for the property name,

then that'll be used by this /info endpoint.

So, here's a little screenshot here,

so I have actuator/info, and it'll send back a JSON object

that has the information from this given properties file.

And again, remember, everything's keyed on the info.

So, anything following info. will be used

as part of this given JSON object.

And you can customize it, you can add as much details here

as you'd like for this given info for your application.

Now, let's take a look at some other

Spring Boot Actuator endpoints.

So, there's actually 10+ actuator endpoints

that are available.

Here's a small sample.

So, you have /auditevents.

It gives you a list of the audit events

for your application.

/beans will give you a list of all beans

that are registered in the Spring application context.

/mappings will give you a list of all request mappings

for your given application.

Now, for a full list of all of the actuator endpoints,

you simply go to this link here,

luv2code.com/actuator-endpoints,

and it'll redirect you to the official

Spring Boot Actuator documentation, and you can see

a full list of all of those actuator endpoints.

All right, now, by to default only the /health endpoints

are exposed.

If you want to expose all of the actuator endpoints

over the web, then you simply make this entry here

in your properties file.

So, in application.properties,

we can make use of the wildcard to expose all endpoints.

We can also expose individual endpoints

with a comma-delimited list.

But for right now, we'll use the wildcard.

So, I'll say management.endpoints.web.exposure.include

equals star.

So, this given entry here will expose

all of the Spring Boot Actuator endpoints over the web.

Now, once we have that set up to get a list of beans

for a given application,

then we can go to localhost/actuator/beans,

and it'll give us an actual dump, or a JSON,

of all of the beans that are registered

with this Spring Application context.

So this is pretty cool, but, and hold on here,

you're probably wondering, what about security?

(instructor laughing)

Because I really don't wanna expose

all of this information to anyone on the web.

And I got you covered.

So, we'll actually cover security

in some of the later videos.

So, we'll actually add security,

and we'll lock down these Spring Boot Actuator endpoints

only to authorized users who have to log in

with the user ID and password.

So, we'll cover all of those steps in later videos.

Okay. So, let's go ahead and look

at the development process.

So, the first step is simply editing our Maven POM file,

and we add the spring-boot-starter-actuator dependency.

Then we can go through and view the actuator endpoints

for /health and /info.

And remember, we get all those endpoints for free.

And then we can actually edit our application.properties,

and customize the /info endpoint,

so we can give specific information, or custom information,

for our given application.

And we'll cover that in the next section here.". Can you also explain it shortly so i can understand better what is that and what's it's purpose?