Wednesday, 11 January 2017

Configuring Spring Boot Actuator information in Pivotal Cloud Foundry 1.9 Applications Manager

With the release of Pivotal Cloud Foundry 1.9 we added "Spring Boot Actuator In PCF" through Applications Manager Web UI. In this example below I will show what config you need on your application side to get Apps Manager Web UI to show you this information.

Spring Boot Actuator exposes information about a running Spring Boot application via an http endpoint. Get useful diagnostics about an app programmatically using these RESTful APIs:  health, git commit, build information, and so on. Now, developers can view some of this data in PCF Apps Manager. It’s easier to debug and monitor your apps in production, since Apps Manager shows this diagnostics info in context.

The steps are are described here BUT the steps below are more detailed and provide a sample application to verify this with.

1. Add the maven dependency "spring-boot-starter-actuator" to your pom.xml


2. Ensure your using Spring Boot 1.5 snapshots/release candidates/final as earlier versions won't work.
  <relativePath/> <!-- lookup parent from repository -->

3. Configure the Info Actuator as per link below

Note: It will differ depending on if your using Maven or Gradle

Ensure you add this property for GIT integration in your YML file or properties file, YML example

      mode: full

4. The following demo below has the required setup for verification application , clone and push to CF as shown below.

Note: review pom.xml for everything that is needed for this to work

$ git clone
$ mvn package
$ cf push -f manifest-inmemory-db.yml


0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
1 of 1 instances running

App started


App pas-springboot-pcf was started using this command `CALCULATED_MEMORY=$($PWD/.java-buildpack/open_jdk_jre/bin/java-buildpack-memory-calculator-2.0.2_RELEASE -memorySizes=metaspace:64m..,stack:228k.. -memoryWeights=heap:65,metaspace:10,native:15,stack:10 -memoryInitials=heap:100%,metaspace:100% -stackThreads=300 -totMemory=$MEMORY_LIMIT) && JAVA_OPTS="$TMPDIR -XX:OnOutOfMemoryError=$PWD/.java-buildpack/open_jdk_jre/bin/ $CALCULATED_MEMORY" && SERVER_PORT=$PORT eval exec $PWD/.java-buildpack/open_jdk_jre/bin/java $JAVA_OPTS -cp $PWD/. org.springframework.boot.loader.JarLauncher`

Showing health and status for app pas-springboot-pcf in org pivot-papicella / space development as

requested state: started
instances: 1/1
usage: 1G x 1 instances
last uploaded: Wed Jan 11 03:59:24 UTC 2017
stack: cflinuxfs2
buildpack: java-buildpack=v3.10-offline- java-main java-opts open-jdk-like-jre=1.8.0_111 open-jdk-like-memory-calculator=2.0.2_RELEASE spring-auto-reconfiguration=1.10.0_RELEASE

     state     since                    cpu      memory         disk           details
#0   running   2017-01-11 03:00:18 PM   207.1%   489.9M of 1G   161.7M of 1G

5. View the application in Application Manager UI as shown below and you will see that a Spring Icon appears next to the application name

More Screen Shots

More Information

No comments: