Search code examples
spring-bootspring-boot-actuator

Spring-boot 2.0.0 M1 - Actuator not working


I have a Spring-boot project that uses spring-boot actuator to provide application statistics and metrics.

The actuator functionality is being provided by adding "spring-boot-starter-actuator" to the project.

At this point, security is disable, so the project does not import spring-security.

Using spring-boot 1.5.x, all actuator Endpoints (automatic provided, as the /info, as well as my specific defined endpoints), are working correctly.

After updating to Spring-boot 2.0.0 M1, the actuator endpoints are no longer exposed. Invoking the /info endpoint returns the following error:

{"timestamp":1496948526890,"status":404,"error":"Not Found","message":"No 
message available","path":"/info"}

A note regarding Tomcat: i'm redefining the tomcat.version property, in order to use version 9.

  • When using spring-boot 1.5.x, tomcat.version=9.0.0.M9
  • When using spring-boot 2.0.0.M1, tomcat.version=9.0.0.M21

Solution

  • It look's like the endpoint is no longer mapped to /info

    2017-06-08 13:11:57.817 [main] INFO o.s.b.a.e.mvc.EndpointHandlerMapping - Mapped "{[/application/info || /application/info.json],methods=[GET],produces=[application/vnd.spring-boot.actuator.v2+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke()

    and according to the 2.0.0/SNAPSHOT documentation this is expected.

    https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#production-ready-endpoints

    Try /application/info