I am using spring-boot-starter-actuator in my project wanted to show service starts date time along with other information on /info end point. Please guide how to achieve this. Thanks in advance
I am using spring-boot-starter-actuator in my project wanted to show service starts date time along with other information on /info end point. Please guide how to achieve this. Thanks in advance
/startup - is the Actuator Endpoint to see the startup information.
Sample URL syntax:
http://<HOST>:<port>/actuator/startup
For more info, visit here
--- Edit---
/startup endpoint does not get exposed by default, Hence need to enable explicitly by below property in application.properties :
management.endpoints.web.exposure.include=startup
BufferingApplicationStartup class is in-memory buffered implementation for capturing startup steps. Hence in the main class below changes are required:
import java.util.TimeZone;
import javax.annotation.PostConstruct;
import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup;
@SpringBootApplication public class ActuatorEndpointApplication {
public static void main(String[] args) {
// SpringApplication.run(ActuatorEndpointApplication.class, args);
SpringApplication app = new SpringApplication(ActuatorEndpointApplication.class);
app.setApplicationStartup(new BufferingApplicationStartup(2048));
app.run(args);
}
}
Now test the url:
http://<HOST>:<port>/actuator/startup in Chrome/Postman.
For more info, refer here