Search in docs

Results ..

No results for ''
Search by Algolia

Java Metrics

Bleemeo agent supports monitoring Java application with Java Management Extensions (JMX). By default for any monitored JVM, it will gather metrics about memory usage (heap and non-heap) and garbage collection time.


A Java environment is required to retrieve JMX metrics. It is not installed by default in Bleemeo. To support JMX metrics, install the additional package bleemeo-agent-jmx.

For Ubuntu/Debian:

sudo apt-get install bleemeo-agent-jmx

For CentOS/Fedora:

sudo yum install bleemeo-agent-jmx

Monitor a Java application

For supported services, Bleemeo agent try to auto-detect the JMX port, if it succeeds no manual configuration is needed.

To monitor a Java application, create a configuration file with the following content (/etc/glouton/conf.d/50-java.conf):

- id: myapplication
jmx_port: 1234

With this configuration, Bleemeo agent will use JMX on TCP port 1234 to gather metrics:

myapplication_jvm_gcNumber of garbage collection per second
myapplication_jvm_gc_timeTime spent doing garbage collection in milliseconds per second
myapplication_jvm_gc_utilizationGarbage collection utilization in percent
myapplication_jvm_heap_usedHeap memory used in bytes
myapplication_jvm_non_heap_usedNon-Heap memory used in bytes

It is also possible to provide a username and password if authentication is required to access JMX:

- id: myapplication
jmx_port: 1234
jmx_username: monitorRole
jmx_password: secret

Custom JMX metrics

In addition to the default metrics monitored, any metrics exported by JMX can be gathered. You only need to known the mbean name and attribute name to the metric. Then add the following to your Bleemeo agent configuration (/etc/glouton/conf.d/50-java.conf):

- id: myapplication
jmx_port: 1234
- name: heap_size_mb
mbean: java.lang:type=Memory
attribute: HeapMemoryUsage
# HeapMemoryUsage attribute is a composite attribute with
# committed, init, max and used sub-attribute.
# path is used to select the wanted one.
path: used
scale: 0.000000954 # 1 / 1024 / 1024
- name: request
mbean: com.bleemeo.myapplication:type=ClientRequest
attribute: Count
# The bean expose total request since JVM start. With derive=True,
# Bleemeo-agent will return the number of request per second.
derive: True

The above configuration will create two metrics:

myapplication_heap_size_mbThe size of the heap memory in megabytes
myapplication_requestThe number of request per second that a custom application does