Configuring Spring Boot Actuator Endpoints for Apps Manager

Page last updated:

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

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

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

Overview

The Apps Manager integration with Spring Boot does not use the standard Spring Boot Actuators. Instead, it uses a specific set of actuators that are secured using the Space Developer role for the space that the application runs in. Authentication and authorization are automatically delegated to the Cloud Controller and the User Account and Authentication server without any configuration from the user.

By default, actuators are secure and cannot be accessed without explicit configuration by the user, even if Spring Security is not included. This allows users to take advantage of the Spring Boot Apps Manager integration without accidentally exposing their actuators without security.

Actuator Endpoints

The table below describes the Spring Boot Actuator endpoints supported by Apps Manager. To integrate these endpoints with Apps Manager, you must first Activate Spring Boot Actuator for Your App.

Endpoint About
/info
/health
  • Description: Shows health status or detailed health information over a secure connection.
    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 of the Spring Boot documentation.
  • How to use in Apps Man: See View App Health.
/loggers
  • Description: Lists and allows modification of the levels of the loggers in an app.
  • How to use in Apps Man: See Manage Log Levels.
/dump
  • Description: Generates a thread dump.
  • How to use in Apps Man: See View Thread Dump.
/trace
  • Description: Displays trace information from your app for each of the last 100 HTTP requests. For more information, see the Tracing section of the Spring Boot documentation.
  • How to use in Apps Man: See View Request Traces.
/heapdump
  • Description: Generates a heap dump and provides a compressed file containing the results.
  • How to use in Apps Man: See Download Heap Dump.

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 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 below that correspond to your project 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