Monitoring of Connection Pool metrics for applications running on Cloud Foundry

Document ID : KB000122802
Last Modified Date : 10/12/2018
Show Technical Document Details
We have a java application running on Cloud Foundry instrumented with the default APM agent that’s included in the default Java build pack.   It would be very helpful for us to see some kind of JDBC connection pool metrics, like pool size, active connections, free connections or metrics like that.   For Tomcat and Liberty in non Cloud Foundry environments we get these via JMX, are there any options to get metrics like that for Applications running on Cloud Foundry?
Agent properties can be passed in as java options (JAVA_OPTS) in the cloud foundry manifest.yml file. For example to enable JMX for Tomcat (which is not enabled by default) add the following JAVA_OPTS definition

- name: sample-app
  memory: 1G
  random-route: true
  path: build/libs/sample-app.jar
      JAVA_OPTS : "-Dintroscope.agent.jmx.enable=true*"

The manifest.yml is discussed in the documentation for running the Java agent in Cloud Foundry