Manage and monitor app with Spring Boot Actuator
Note
The Basic, Standard, and Enterprise plans will be deprecated starting from mid-March, 2025, with a 3 year retirement period. We recommend transitioning to Azure Container Apps. For more information, see the Azure Spring Apps retirement announcement.
The Standard consumption and dedicated plan will be deprecated starting September 30, 2024, with a complete shutdown after six months. We recommend transitioning to Azure Container Apps.
Spring Boot Actuator brings production-ready features to your apps. You can effortlessly monitor your app, collect metrics, and understand the status or database activity with this tool. You gain access to professional-grade tools without needing to build them from scratch.
The actuator exposes vital operational data about your running application, like health status, metrics, information, and more. The actuator uses HTTP endpoints or Java Management Extensions (JMX), making it easy to interact with. After you integrate it, it provides several default endpoints, and like other Spring modules, it's easily configurable and extendable.
Azure Spring Apps uses the actuator for enriching metrics through JMX.
Configure Spring Boot Actuator
The following sections describe how to configure the actuator.
Add actuator dependency
To add the actuator to a Maven-based project, add the following dependency:
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
</dependencies>
This configuration works with any Spring Boot version because versions are covered in the Spring Boot Bill of Materials (BOM).
Configure actuator endpoint
By default, a Spring Boot application exposes the health
endpoint only. To observe the configuration and configurable environment, use the following steps to enable the env
and configprops
endpoints as well:
Go to app Overview pane, select Configuration in the setting menu, and then go to the Environment variables configuration page.
Add the following properties as in the "key:value" form. This environment opens the following Spring Actuator endpoints:
health
,env
, andconfigprops
.management.endpoints.web.exposure.include: health,env,configprops
Select Save. Your application restarts automatically and loads the new environment variables.
You can now go back to the app Overview pane and wait until the Provisioning Status changes to Succeeded.
To view all the endpoints built-in and related configurations, see the Exposing Endpoints section of Spring Boot Production-ready Features.
Secure actuator endpoint
When you open the app to the public, these actuator endpoints are exposed to the public as well. We recommend that you hide all endpoints by setting management.endpoints.web.exposure.exclude=*
, because the exclude
property takes precedence over the include
property. This action blocks Application Live View in the Enterprise plan and other apps or tools that rely on the actuator HTTP endpoint.