Actuators without spring-boot-starter-actuator dependency

Viewed 61

Actuators are really helpful when it comes to having production-ready features.

We generally use spring-boot-starter-actuator dependency.

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

Can we get these actuator endpoints by using other dependencies like Spring Boot Starter Web alone from org.springframework.boot?

Do actuators come along with all Spring Boot dependencies?

1 Answers

Looking to the currently newest version 2.7.2 at Maven Central you can learn it is used by a lot of uploaded artifacts including the Spring ones. Sadly Maven doesn't implement a smart filter on the webpage.

Just a few to name from the first 10 pages:

  • spring-cloud-context:3.1.3 (optional)
  • spring-cloud-commons:3.1.3 (optional)
  • spring-cloud-stream:3.2.4 (optional)
  • spring-cloud-bus:3.1.2 (optional)
  • spring-cloud-config-client:3.1.3 (optional)
  • spring-cloud-sleuth-zipkin:3.1.3 (optional)
  • spring-cloud-config-server:3.1.3 (optional)
  • stream-applications-micrometer-common:3.2.1 (non-optional)
  • spring-cloud-stream-binder-kafka:3.2.4 (optional)
  • spring-cloud-stream-binder-rabbit:3.2.4 (optional)
  • stream-applications-security-common:3.2.1 (optional)
  • spring-cloud-starter-netflix-zuul:2.2.10.RELEASE (non-optional)
  • spring-cloud-openfeign-core/3.1.3 (optional)
  • spring-cloud-sleuth-core:2.2.8.RELEASE (optional)
  • spring-cloud-netflix-eureka-client:3.1.3 (optional)

The <optional>true</optional> dependencies are prevented from being transitively included. While you can see the pattern that the Spring authors generally make this dependency optional regardless of the family (I haven't found a boot starter with the Actuator dependency, to be honest). You cannot rely on the actuator will or will not be included.

Related