Spring Boot Actuators – How to use it in application

SpringBoot – Actuators
Spring Boot Actuator brings in several production grade services to your application. Spring Boot Actuators has various number of built-in endpoints.

Actuators helps us monitor and interact with your application. Spring Boot also lets us to create our own endpoints too. These end points can be both enabled or disabled.

Below are some of the Spring Boot Actuator endpoints,

EndPoint Description
/actuator/health Basic health information of the application
/actuator/configprops list of all @ConfigurationProperties
/actuator/info Arbitrary Information
/actuator/auditevents audit events of the application
/actuator/httptrace HTTP trace information
/actuator/metrics Metrics information of the application
/actuator/mappings @RequestMappings in the application
/actuator/scheduledtasks Scheduled tasks in the application
/actuator/shutdown Shutdowns the application

Let us write a sample application to test the spring boot actuator end points.

pom.xml

add this property in application.properties,

application.properties

SampleController.java

App.java

Let us start the application,

 

Once the application is started, we can see the actuators are getting initialized. when we hit localhost:8080/actuator/{endpoint} we can see the information

Here are some sample endpoint outputs,

/actuator/health

/actuator/mappings

/actuator/httptrace

Download Example here

One thought on “Spring Boot Actuators – How to use it in application

Leave a Reply

Your email address will not be published. Required fields are marked *