The Spring Boot Actuator module provides advanced production-ready features such as monitoring, metrics, health checks, etc. The Spring Boot Actuator enables you to monitor the application using HTTP endpoints and JMX. In this tutorial we will learn how to get started with it.

In order to kick-start the Spring Boot Actuator it is sufficient to include the spring-boot-starter-actuator to autoconfigure Actuator. You can then take advantage of Actuator’s features in order to monitor a Spring Boot application:

$ spring init -dweb,actuator actuator-demo

Here is the list of depdendencies which has been added:



Now if you run the entry point class, you can check the metrics available:

./mvnw spring-boot:run
INFO 10420 --- [           main] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 2 endpoint(s) beneath base path '/actuator'
INFO 10420 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
INFO 10420 --- [           main] c.example.actuatordemo.DemoApplication   : Started DemoApplication in 7.944 seconds (JVM running for 30.702)
INFO 10420 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
INFO 10420 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
INFO 10420 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 23 ms

As you can see from the Console logs, unlike in Spring Boot 1.x, Actuator comes with most endpoints disabled, thus, the only two available by default are /health and /info. We can check them, under the "actuator" context:

$ curl http://localhost:8080/actuator/health

We can also customize the data shown by the metrics. For example, if we want to customize the "/info", we can modify the "" properties in Spring Sample Application is an example of Spring Boot Actuator

This results in:

curl http://localhost:8080/actuator/info
{"build":{"name":"Demo Spring Sample Application","description":"This is an example of Spring Boot Actuator","version":"1.0.0"}}

How to enable additional Acutator endpoints

In order to enable all the available Actuator endpoints you have to set the following property into the file:


As you can see from the Application Logs, now the following endpoints are available:

INFO 11550 --- [           main] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 15 endpoint(s) beneath base path '/actuator'

Let's check for example that it worked by requesting the "metrics" endpoint:

$ curl http://localhost:8080/actuator/metrics

You can also explicitly enable/disable a specific endpoint (for example /beans), as follows:


To expose all enabled endpoints except one (for example /env), we use:


Configurable Endpoints

The following Actuator endpoints are autoconfigured by the Actuator starter with the default settings:

    • info: Displays arbitrary application info.
    • health: Shows application basic health info for unauthenticated users and full details for authenticated users.
    • beans: Shows a list of all Spring beans configured in the application.
    • autoconfig: Displays an autoconfiguration report showing all autoconfiguration candidates and the reason they were/were not applied.
    • mappings: Displays a collated list of all @RequestMapping paths.
    • configprops: Displays a collated list of all @ConfigurationProperties.
    • metrics: Shows metrics information for the current application.
    • env: Exposes properties from Spring’s ConfigurableEnvironment.
    • trace: Displays trace information (by default, the last 100 HTTP requests).
    • dump: Performs a thread dump.
    • loggers: Shows and modifies the configuration of loggers in the application.
    • auditevents: Exposes audit events information for the current application.
    • flyway: Shows any Flyway database migrations that have been applied.
    • liquibase: Shows any Liquibase database migrations that have been applied.
    • actuator: Provides a hypermedia-based “discovery page” for the other endpoints.
    • shutdown: Allows the application to be gracefully shut down (not enabled by default).
FREE WildFly Application Server - JBoss - Quarkus - Drools Tutorials