springspring-bootspring-boot-actuatorspring-actuator

How to enable all SpringBoot actuator endpoints?


SpringBoot v2.5.1

I would like to have all actuator endpoints (described in documentation) available. Following the docs, have added actuator starter dependency and a property, but most of the endpoints are not available (HTTP 404).

The only available endpoint is GET /actuator/health, but it shows useless info: {"status": "UP"}

Added property management.endpoints.enabled-by-default=true.

Added dependency:

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

Result of GET /actuator

{
    "_links": {
        "self": {
            "href": "http://localhost:9999/actuator",
            "templated": false
        },
        "health-path": {
            "href": "http://localhost:9999/actuator/health/{*path}",
            "templated": true
        },
        "health": {
            "href": "http://localhost:9999/actuator/health",
            "templated": false
        }
    }
}

What is the minimal set up to enable actuator endpoints?


Solution

  • I am using IntelliJ IDEA 2024.1.4 (Ultimate Edition) for macOS.

    I followed these steps,

    Simply add the dependency to your pom.xml file.

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

    Next, update the application.properties file.

    To expose all endpoints, use the wildcard *. Alternatively, you can expose individual endpoints with a comma-delimited list (e.g., health,info,...)

    management.endpoints.web.exposure.include=*
    

    Please note that the console will display additional endpoints, with actuator endpoints being prefixed by /actuator.

    endpoints

    To view actuator endpoints, go to /mappings. This is for demonstration, so you can try any endpoint from the full list.

    mappings

    You can install the JSON Formatter extension to make JSON easier to read.