In this tutorial, you will learn about the difference between two Spring Boot dependencies – Spring Boot Actuator and Spring Boot Starter Actuator. If you’re new to Spring Boot, these terms may sound confusing, but don’t worry, by the end of this tutorial, you’ll understand the difference between them.
Spring Boot is a popular framework for building Java applications. One of its key features is the Actuator module, which provides production-ready features for monitoring and managing the application. The Actuator module exposes several endpoints over HTTP, such as health checks, metrics, and application info, which can be used for monitoring and management purposes.
Difference Between Spring Boot Actuator and Spring Boot Starter Actuator
Now, let’s talk about the two dependencies – Spring Boot Actuator and Spring Boot Starter Actuator.
- Spring Boot Actuator: This is the core Actuator framework, which provides the endpoints and metrics required for monitoring and managing the application. However, it does not configure the endpoints automatically. If you include this dependency in your project, you’ll have to configure the endpoints manually.
- Spring Boot Starter Actuator: This is a starter module that includes the Spring Boot Actuator dependency and auto-configures the Actuator endpoints. This means that you can use the Actuator endpoints and metrics out of the box without any additional configuration. This dependency also includes additional dependencies required for certain endpoints, such as Micrometer for metrics and Logback for logging.
So, in summary, if you want to use the Actuator framework in your Spring Boot application, you’ll need to include the Spring Boot Actuator dependency. However, if you want to use the Actuator endpoints and metrics out of the box, you should include the Spring Boot Starter Actuator dependency instead. Spring Boot Starter Actuator module not only includes the core Actuator framework but also provides auto-configuration of the Actuator endpoints, making it easier for you to use the Actuator features in your project.
To learn more about Actuator, check out the following tutorials:
- Spring Boot Actuator tutorial,
- How to enable Actuator’s HttpTrace endpoint in Spring Boot 3,
- Securing Actuator Endpoints – Best Practices,
- Securing Spring Boot Actuator’s Endpoints with Basic Authentication,
- Viewing API Gateway Routes with Spring Boot Actuator.
I hope this tutorial has helped you understand the difference between Spring Boot Actuator and Spring Boot Starter Actuator. If you have any questions, feel free to ask in the comments.