LATEST VERSION: 1.10 - CHANGELOG
Pivotal Cloud Foundry v1.10

Configuring Spring Boot Actuator Endpoints for Apps Man

Page last updated:

The Apps Manager UI supports several production ready-endpoints from Spring Boot Actuator. This topic describes how you can configure your app to display data from the Actuator endpoints in Apps Manager.

Note: This feature requires Spring Boot v1.5 or later.

For information about how you view the data from these endpoints in Apps Manager, see the Using Spring Boot Actuator Endpoints in Apps Manager topic.

Overview: Spring Boot Actuators

Spring Boot Actuator provides services for monitoring and managing your Spring Boot app. You can add Actuators to your app project and access them through HTTP endpoints.

Apps Manager supports the following endpoints:

  • /info: Exposes details about application environment, git, and build
  • /health: Shows health status or detailed health information over a secure connection
  • /loggers: Lists and allows modification of the levels of the loggers in an application

For more information about Spring Boot Actuators, see the Spring Boot Actuator documentation.

Activate Spring Boot Actuator for Your App

You must add a spring-boot-starter-actuator dependency to your app project for the production-ready HTTP endpoints to return values. For more information, see the Enabling production-ready features section of the Spring Boot documentation.

  1. Follow the instructions below that correspond to your project type.

    • Maven: If you use Maven, add the following to your project:
      <dependencies>
          <dependency> 
              <groupId>org.springframework.boot</groupId>
              <artifactId>spring-boot-starter-actuator</artifactId>
          </dependency>
      </dependencies>
      
    • Gradle: If you use Gradle, add the following to your project:
      dependencies {
          compile("org.springframework.boot:spring-boot-starter-actuator")
      }
      
  2. If you use self-signed certificates in your PCF deployment for UAA or the Cloud Controller, specify in your application.properties file to skip SSL validation:

    management.cloudfoundry.skip-ssl-validation=true
    
    See Cloud Foundry support in the Spring Boot Actuator documentation for more information.

Configure the Health Actuator

Spring Boot Actuator includes the auto-configured health indicators specified in the Auto-configured HealthIndicators section of the Spring Boot documentation. If you want to write custom health indicators, see the Writing custom HealthIndicators section.

Configure the Info Actuator

The /info endpoint provides information about the project build for your app, as well as its git details.

Add Build Information

To add build information to the /info endpoint, follow the instructions for your project build type:

Maven

Add the following to your app project:

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <version>1.4.2.RELEASE</version>
            <executions>
                <execution>
                    <goals>
                        <goal>build-info</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

Gradle

Add the following to your app project:

springBoot  {
    buildInfo()
}

Add Git Information

To add git information to the /info endpoint, follow these instructions:

  1. Add the following property to your application.properties file:

    management.info.git.mode=full
    
  2. Follow the instructions below that correspond to your project type:

Maven

Add the following plugin to your project:

<build>
    <plugins>
        <plugin>
            <groupId>pl.project13.maven</groupId>
            <artifactId>git-commit-id-plugin</artifactId>
        </plugin>
    </plugins>
</build>

Gradle

Add the following plugin to your project:

plugins {
    id "com.gorylenko.gradle-git-properties" version "1.4.6"
}
Create a pull request or raise an issue on the source for this page in GitHub