Search⌘ K
AI Features

Actuator

Explore how to use Spring Boot Actuator to monitor and manage your application through various endpoints such as health checks, metrics, and bean information. Understand how to enable, configure, and secure Actuator features to gain valuable runtime insights that help maintain application performance and reliability.

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.

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:

XML
<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:

XML
<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 ...