Spring Boot Actuator

The spring boot actuator is another sub project for spring boot framework. It includes some of the features that help us to manage and monitor the spring boot applications. It provides us set of HTTP and JMX endpoints to manage and monitor the your spring boot application. If you want to develop the production grade application you have to include spring boot actuator in your spring boot application.

Features

There are three features in Spring Boot Actuator,

  1. Endpoints
  2. Metrics
  3. Audit

Endpoint

The Spring Boot Actuator provides us multiple built-in endpoints to monitor the your applications. And we can also add your own endpoint. Actuator allows us to enable or disable built-in end point. There are some properties, you just need to put it in your application properties file to enable or disable endpoint. You can access those endpoints over HTTP as given below.

Important Endpoints

Metrics

The micrometer is integrated into Spring Boot. It provides a vendor-neutral interfaces for timers, gauges, counters, distribution summaries, and long task timers with a dimensional data model.

Audit

Spring boot provides the audit framework, that public event to AuditEventRepository. It publishes the authentication event automatically if spring security is in execution.

pom.xml

<dependency>
			<groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
		</dependency>

application.properties

management.endpoints.web.exposure.include=*    #// It will be include all actuator endpoints
management.endpoints.web.exposure.exclude= env #// It will be exclude the specified endpoints

#Enabale spring security
management.security.enabled=true  
management.security.roles=ADMIN  
security.basic.enabled=true  
security.user.name=admin  
security.user.passowrd=admin  
Spring Boot Starter Actuator