DEV Community

Code Green for CodeGreen

Posted on

What are Spring Boot Actuator endpoints?

Spring Boot Actuator endpoints provide a set of built-in HTTP endpoints that expose useful information and operations about the running Spring Boot application. These endpoints are invaluable for monitoring, managing, and troubleshooting the application in production.

Here are some commonly used Spring Boot Actuator endpoints:

  • /actuator/health: Provides information about the health of the application, including status, details, and any additional health checks.
  • /actuator/info: Displays custom application information, such as version, description, and any other details configured by the developer.
  • /actuator/metrics: Exposes various metrics about the application, such as memory usage, garbage collection statistics, HTTP request statistics, etc.
  • /actuator/env: Allows viewing and managing environment properties of the application, including configuration properties and system environment variables.
  • /actuator/beans: Provides a list of all beans in the application context along with their dependencies.
  • /actuator/trace: Displays trace information for recent HTTP requests handled by the application.

Example:

To enable Spring Boot Actuator endpoints, we simply need to include the spring-boot-starter-actuator dependency in our project's configuration:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
Enter fullscreen mode Exit fullscreen mode

Once Actuator is included, we can access the endpoints via HTTP requests. For example, to check the health of our application, we can send a GET request to /actuator/health.

These endpoints offer valuable insights into the runtime behavior of our Spring Boot application, allowing us to monitor its health, performance, and various other aspects, ultimately facilitating efficient management and troubleshooting.

Top comments (0)