springspring-bootspring-boot-actuator

Can we define an endpoint in spring that starts with /actuator ? Which one will take preference?


If we define our own request mapping for "localhost:8080/actuator/health" will it be registered? Will it instead call the spring actuator?


Solution

  • I tried this in Spring Boot 3.4.4 with spring-boot-starter-actuator. The application started fine and the actuator path showed the library actuator, and ignored the controller method.

    I was expecting this to throw an ambiguous mapping exception, but it didn't.