The ostrich project from Twitter seems to be a good fit for my use case where I would like to track lot of JVM based statistics plus some custom statistics.
https://github.com/twitter/ostrich/
However, my code base is pure Java + Spring 3.0, rather than Scala, so can I use Ostrich for my case?
I have used Metrics. It is very similar to Ostrich with support for gauges, counters, meters, histograms, and timers; As well a a mechanism to monitor the health check of your services.
You can get the report over JMX, or HTTP as well as reporting backends like Ganglia and Graphite.
The combination of MBeans, JMX, and the JConsole application provide this natively for both local as well as remote JVMs.
The javax.management package ( http://www.oracle.com/technetwork/java/javase/tech/javamanagement-140525.html ) extensions support this : http://www.oracle.com/technetwork/java/javase/tech/javamanagement-140525.html.
The JMX+JConsole monitoring paradigm is native in your JVM, and increasingly easy to implement in java SE 1.6 on.
The Java virtual machine (Java VM ) has built-in instrumentation that enables you to monitor and manage it using the Java Management Extensions (JMX) technology. From http://docs.oracle.com/javase/6/docs/technotes/guides/management/agent.html#gdevs
Details
The standard way monitor any JVM (client, server, local, or remote) is using JConsole : http://docs.oracle.com/javase/6/docs/technotes/guides/management/jconsole.html. You can have multiple JConsole clients open at once, monitoring different instances.
1) You first launch your JVM services with this argument :
com.sun.management.jmxremote.port=portNum
2) Then , on your remote client (the one you want to do the monitoring) , you can start monitoring this JVM
jconsole hostName:portNum
For integrating JVM Analytics over different servers
1) Try the Clearstone app : I haven't used it, but screenshots appear to support the type of distributed envirnoment that you seem to have :
http://www.evidentsoftware.com/products/clearstone-for-java/
ClearStone for Java includes an out-of-the-box collector that delivers metrics via JMX. The ClearStone server can collect and correlate information from any Java MBean.
**Finally, for another comparison of ostrich and jconsole : **
Remote Probing of Scala/Java Application in Runtime
You can use Ostrich integrated with Heapster.
Heapster
Heapster provides an agent library to do heap profiling for JVM processes with output compatible with Google perftools. The goal of Heapster is to be able to do meaningful (sampled) heap profiling in a production setting.
Ostrich integration
If you use Ostrich, and run your program with heapster, you can generate runtime heap profiles like so:
$ curl 'localhost:9990/pprof/heap?pause=10&sample_period=1024' > /tmp/prof This will collect heap growth for 10 seconds, with a sampling period of 1kB.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With