Spring Boot Actuator

  • Spring Boot Actuator is a sub-project of Spring Boot that provides several production-ready features to help you monitor and manage your application.
  • It provides a variety of endpoints that allow you to retrieve information about the health, performance, and configuration of your application.

Here’s a table of the most commonly used endpoints in Spring Boot Actuator, along with their usage:

EndpointDescription
/actuator/healthReturns information about the health of your application. The endpoint returns a status field with a value of UP if your application is running normally, or DOWN if it’s not.
/actuator/infoReturns general information about your application, such as its version number.
/actuator/metricsReturns metrics information about your application, such as the number of HTTP requests it has processed.
/actuator/envReturns information about your application’s environment, such as the values of its properties.
/actuator/mappingsReturns information about the endpoint mappings in your application.
/actuator/beansReturns information about the beans in your application.
/actuator/configpropsReturns information about the configuration properties in your application.

To use Spring Boot Actuator, you simply need to add the spring-boot-starter-actuator dependency to your pom.xml file:

By default, only the /actuator/health and /actuator/info endpoints are enabled in a Spring Boot application. To enable other endpoints, you can add the following properties to your application.properties or application.yml file:

This will enable all endpoints. You can also enable specific endpoints by listing them in the include property, separated by commas. For example:

Note that for security reasons, it’s recommended to limit the exposure of the endpoints to only those that you need to use.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top