Actuator

Learn about Spring Boot Actuator and the different monitoring metrics that it provides.

Actuator

Spring Boot Actuator is a feature that provides monitoring features for the application during development and after deployment. It provides metadata about the application like the beans configured, how autoconfiguration has worked, how many times a specific service is called, how many times a specific service has failed, etc.

Press + to interact
Spring Boot Actuator
Spring Boot Actuator

Actuator dependency

The Actuator module can be enabled while creating a Spring Boot application by adding the Actuator dependency from the Ops section. For an application that is already running, spring-boot-starter-actuator can be added to the pom.xml file as follows:

Press + to interact
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

HAL browser dependency

The Actuator exposes a lot of REST services that are compliant with the HALHAL standard. We will use a HAL browser to view the data provided by the services. A HAL browser is a tool that understands the HAL format and can render it in a human-readable format, allowing us to explore the API and follow links between resources. For this, add the following dependency:

Press + to interact
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-rest-hal-browser</artifactId>
<version>3.3.6.RELEASE</version>
</dependency>
  • Since we have enabled the HAL browser, if we type localhost:8080, we will be taken to the HAL browser that we can use to browse through the Actuator by typing /actuator ...