Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/spring-projects/spring-boot/llms.txt

Use this file to discover all available pages before exploring further.

Actuator endpoints let you monitor and interact with a running Spring Boot application over HTTP or JMX. Spring Boot ships with a comprehensive set of built-in endpoints and a straightforward model for adding your own. An endpoint is considered available when its access is permitted and it is exposed; by default only the health endpoint is exposed over HTTP.

Built-in endpoints

EndpointDescription
/actuator/healthShows application health information, including the status of dependent systems.
/actuator/infoDisplays arbitrary application information (build, git, environment, OS, Java).
/actuator/startupShows startup step data collected by ApplicationStartup. Requires BufferingApplicationStartup.
The info endpoint surfaces properties from InfoContributor beans. Auto-configured contributors include build info, git commit details, Java runtime information, OS information, and process information.
info:
  app:
    encoding: "UTF-8"
    java:
      source: "17"
      target: "17"
To expose full git commit details instead of only branch, commit.id, and commit.time:
management:
  info:
    git:
      mode: "full"
EndpointDescription
/actuator/metricsShows metrics collected by Micrometer. Drill into individual meters by name, e.g. /actuator/metrics/jvm.memory.max.
/actuator/threaddumpPerforms a thread dump of the JVM.
/actuator/heapdumpReturns a heap dump file (HPROF on HotSpot, PHD on OpenJ9). Web applications only.
/actuator/scheduledtasksDisplays all scheduled tasks in your application.
/actuator/httpexchangesDisplays the last 100 HTTP request-response exchanges. Requires an HttpExchangeRepository bean.
Append tag=KEY:VALUE query parameters to filter metrics by dimension:
GET /actuator/metrics/jvm.memory.max?tag=area:nonheap
EndpointDescription
/actuator/beansLists all Spring beans in the application context.
/actuator/envExposes properties from the Spring Environment. Values are sanitized by default.
/actuator/configpropsShows all @ConfigurationProperties beans and their values.
/actuator/conditionsShows auto-configuration condition evaluation results and why conditions matched or did not.
/actuator/mappingsLists all @RequestMapping paths.
The /env, /configprops, and /quartz endpoints sanitize sensitive values (replacing them with ******) by default. Control visibility with show-values:
management:
  endpoint:
    env:
      show-values: when-authorized
      roles: "admin"
Valid options: never (default), always, when-authorized.
EndpointDescription
/actuator/loggersViews and modifies logger levels at runtime.
/actuator/cachesExposes available caches and allows cache eviction.
/actuator/shutdownGracefully shuts down the application. Disabled by default; requires jar packaging.
/actuator/sessionsRetrieves and deletes user sessions from a Spring Session store.
To enable the shutdown endpoint:
management:
  endpoint:
    shutdown:
      access: unrestricted
To set a logger level at runtime, POST to /actuator/loggers/{logger.name}:
{
    "configuredLevel": "DEBUG"
}
Pass null as configuredLevel to reset a logger to its default configuration.
EndpointDescription
/actuator/flywayShows Flyway database migrations that have been applied. Requires a Flyway bean.
/actuator/liquibaseShows Liquibase database migrations that have been applied. Requires a Liquibase bean.
EndpointDescription
/actuator/auditeventsExposes audit event information. Requires an AuditEventRepository bean.
/actuator/integrationgraphShows the Spring Integration graph. Requires spring-integration-core.
/actuator/prometheusExposes Micrometer metrics in Prometheus scrape format. Requires micrometer-registry-prometheus.
/actuator/quartzShows Quartz Scheduler job information.
/actuator/sbomExposes a Software Bill of Materials. CycloneDX SBOMs are auto-detected.
/actuator/logfileReturns the log file contents if logging.file.name or logging.file.path is configured.

Configuring endpoint caching

Endpoints automatically cache responses to read operations that take no parameters. Set cache.time-to-live per endpoint:
management:
  endpoint:
    beans:
      cache:
        time-to-live: "10s"

Controlling access

By default, access to all endpoints except shutdown and heapdump is unrestricted. Use the management.endpoint.<id>.access property:
management:
  endpoints:
    access:
      default: none
  endpoint:
    loggers:
      access: read-only
To apply an application-wide limit regardless of individual settings, use management.endpoints.access.max-permitted. Set it to read-only to prevent any write operations across all endpoints.

CORS support

CORS is disabled by default. Enable it by setting management.endpoints.web.cors.allowed-origins:
management:
  endpoints:
    web:
      cors:
        allowed-origins: "https://example.com"
        allowed-methods: "GET,POST"

Implementing custom endpoints

Add a @Bean annotated with @Endpoint. Methods annotated with @ReadOperation, @WriteOperation, or @DeleteOperation are automatically exposed over JMX and HTTP (GET, POST, DELETE respectively).
1

Define the endpoint class

import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
import org.springframework.boot.actuate.endpoint.annotation.WriteOperation;
import org.springframework.boot.actuate.endpoint.annotation.DeleteOperation;
import org.springframework.stereotype.Component;

@Component
@Endpoint(id = "myendpoint")
public class MyEndpoint {

    @ReadOperation
    public MyData getData() {
        return new MyData("value");
    }

    @WriteOperation
    public void writeData(String name, int counter) {
        // handle POST with JSON body { "name": "test", "counter": 42 }
    }

    @DeleteOperation
    public void deleteData(String name) {
        // handle DELETE
    }

}
2

Expose the endpoint

management:
  endpoints:
    web:
      exposure:
        include: "health,myendpoint"
3

Access the endpoint

GET /actuator/myendpoint
Use @WebEndpoint to restrict an endpoint to HTTP only, or @JmxEndpoint to restrict it to JMX only. Use @EndpointWebExtension to augment an existing endpoint with additional HTTP-specific operations.

Passing parameters to operations

When exposed over HTTP, parameters are taken from URL query parameters or the JSON request body. Parameters are required by default; annotate with @Nullable (from org.jspecify.annotations) to make them optional.
{
    "name": "test",
    "counter": 42
}

HTTP response status codes

OperationReturns valueHTTP status
@ReadOperationYes200 OK
@ReadOperationNo404 Not Found
@WriteOperation / @DeleteOperationYes200 OK
@WriteOperation / @DeleteOperationNo204 No Content
AnyMissing required param400 Bad Request
Endpoint Java code must be compiled with -parameters to allow input mapping to method parameters. This happens automatically when using Spring Boot’s Gradle plugin or spring-boot-starter-parent with Maven.

Build docs developers (and LLMs) love