This topic tells you how the Spring Boot conventions in Tanzu Application Platform configure Spring Boot actuators automatically. With this feature, users can activate or deactivate the automatic configuration of actuators on Tanzu Application Platform and on individual workloads.
Developers can add a label to their workloads to activate or deactivate the automatic configuration of actuators. By default, all existing and future accelerator projects are configured to activate automatic configuration on the workload level.
To activate or deactivate the automatic configuration of actuators at the workload level:
To activate automatic configuration of actuators, set the following label to true
in your workload YAML:
apps.tanzu.vmware.com/auto-configure-actuators: "true"
If the preceding label is set to true
, the Spring Boot actuator convention sets the following actuator configuration:
JAVA_TOOL_OPTIONS
property is set as -Dmanagement.server.port="8081"
.JAVA_TOOL_OPTIONS
property is set as -Dmanagement.endpoints.web.base-path="/actuator"
.boot.spring.io/actuator: http://:8081/actuator
.In addition to these settings, Application Live View is activated with the following actuator configuration:
tanzu.app.live.view.application.actuator: actuator
.tanzu.app.live.view.application.actuator.port: 8081
.To deactivate automatic configuration of actuators, set the following label to false
in your workload YAML:
apps.tanzu.vmware.com/auto-configure-actuators: "false"
If the preceding label is set to false
, the Spring Boot actuator convention does not set any JAVA_TOOL_OPTIONS
and does not set the annotation boot.spring.io/actuator
.
Application Live View is activated and configured with default values for Spring Boot web applications, assuming that some actuators are activated on the default port. On activating Application Live View, the following actuator settings are set:
JAVA_TOOL_OPTIONS
property is set as -Dserver.port="8080"
.tanzu.app.live.view.application.actuator: actuator
.tanzu.app.live.view.application.actuator.port: 8080
.The Application Live View GUI renders the pages with accessible information based on whether the actuator endpoints are accessible for an application.
By default, as an additional security measure, Spring Boot conventions does not expose all the actuator data over HTTP by exposing all the actuator endpoints. In addition, the information exposed by the health endpoint is not set to always
by default.
If the automatic configuration of actuators is set to true
either at the workload level or platform level, the Spring Boot convention then sets the runtime environment properties management.endpoints.web.exposure.include="*"
and management.endpoint.health.show-details=true
on to the PodSpec to expose all the actuator endpoints and detailed health information. You do not need to add these properties manually in application.properties
or application.yml
.
In contrast to activating or deactivating the automatic configuration of actuators on the level of individual workloads, you can set a global setting for the platform instead. This setting is taken into account ONLY when there is no specific auto-configure-actuators
setting on the individual workload.
To activate or deactivate the automatic configuration of actuators at a global level:
To activate the automatic configuration, when you install Spring Boot conventions, provide an entry in the values.yaml
file. For example:
springboot_conventions:
autoConfigureActuators: true
To deactivate the automatic configuration, you can provide the following entry:
springboot_conventions:
autoConfigureActuators: false
NoteThe default values for both platform level and workload level configuration is false.
To run Application Live View with Spring Boot apps, the Spring Boot convention recognizes PodIntents and adds the following metadata labels:
tanzu.app.live.view: "true"
: Activates the connector to observe application podtanzu.app.live.view.application.name: APPLICATION-NAME
: Identifies the app name to be used internally by Application Live Viewtanzu.app.live.view.application.actuator.port: ACTUATOR-PORT
: Identifies the port on the pod at which the actuators are available for Application Live Viewtanzu.app.live.view.application.flavours: spring-boot
: Exposes the framework flavor of the appTo run Application Live View with Spring Cloud Gateway apps, Spring Boot conventions recognizes PodIntents and adds the following metadata labels:
tanzu.app.live.view: "true"
: Activates the connector to observe application podtanzu.app.live.view.application.name: APPLICATION-NAME
: Identifies the app name to be used internally by Application Live Viewtanzu.app.live.view.application.actuator.port: ACTUATOR-PORT
: Identifies the port on the pod at which the actuators are available for Application Live Viewtanzu.app.live.view.application.flavours: spring-boot,spring-cloud-gateway
: Exposes the framework flavors of the app