Q:

Any idea of health check for Cloud Foundry (Java) application?

We have a Cloud Foundry (Java) application running on IBM Bluemix and we are looking for a way of health check for it. We mainly would like to monitor memory usage (both CF instance memory and JVM heap). We know that Auto-Scaling can do a similar thing but we think it keeps memory usages for recent 2 hours. (Please correct us if we are misunderstanding.) We prefer to monitor memory usage at least recent 24 hours. Any suggestions or comments must be appreciated. Thank you.

A:

From a platform standpoint, you don't have a lot of options:

You can configure an HTTP-based health check for your app.  Instead of just monitoring the port your application is listening to, this will actually send an HTTP request and check that it gets a valid response.  If it does not, then your application will get automatically restarted by the platform.  This does not keep track of any of the metrics that you listed.  It's just purely a check to determine if your application is still alive.
Ex: cf set-health-check my-super-cool-app http --endpoint /health
https://docs.cloudfoundry.org/devguide/deploy-apps/healthchecks.html
You can connect to the firehose and pull metrics.  This will include the container metrics of CPU, RAM & Disk usage.  The firehose is just a method to obtain this information though, the whole problem of storage and pretty graphs is one that you'd still need to solve.
The firehose plugin is the best example of doing this: https://github.com/cloudfoundry-community/firehose-plugin

Beyond the platform itself, you might want to look at an APM (application performance monitoring) tool.  I'm not going to list examples here.  There are many which you can find with a quick Internet search.  Some even integrate nicely with the Java buildpack, those are listed here.
This is probably the solution you want as it will give you all sorts of metrics, including the ones you mentioned above.
Hope that helps!

