. . .

Monitoring Extras

If the monitoring service runs on several nodes, each service has to be informed about the URL of the service registry and each node uses a different server port number.

To configure services, create a /config directory in the installation directory (/opt by default) and create an application.yml file in it:

# Password for the default "user"
security:
user:
password: secret
 
# Tomcat URL for monitoring the JMX values via Jolokia - requires an installation of the jolokia war (https://jolokia.org/download.html)
#tomcat:
# url: http://localhost:8080
 
# Change the port number for the running service; the default port is displayed after startup in the logs.
#server:
# port: 9999
 
eureka:
instance:
# Set your unique hostname here for proper display in eureka
hostname: localhost
client:
serviceUrl:
# URL of the service registry
defaultZone: http://localhost:8761/eureka
 
# Port of other JMX services
jmx:
host: localhost
port: 13991
 
# Storage to use - default is in memory, MongoDB can also be used (without auth)
storage:
useMongo: false
serverNames: localhost
 
# Mbeans to add to monitoring; provide comma separated list of JMX values
mbean:
names: java.lang:type=OperatingSystem,java.lang:type=Runtime,java.lang:type=Threading

Possible MBean names

The mbean.names config value accepts a comma separated list of all MBean names available to the monitoring service. More information about JMX and MBeans can be found here: https://docs.oracle.com/javase/tutorial/jmx/

Without further configuration, the JDK provides at least the following list of MBeans (also available using theJConsole tool of the JDK):

Name

 

java.lang:type=ClassLoading

Information about loaded classes

java.lang:type=Compilation

Information about compilation time

java.lang:type=GarbageCollector

Information abount garbage collection

java.lang:type=Memory

Information about system memory

java.lang:type=OperatingSystem

Information about the operating system

java.lang:type=Runtime

Information about the runtime environment

java.lang:type=Threading

Information about running threads

etc...

 

If further JMX services are attached using the tomcat.url or jmx settings, even more possible MBeans can be read. For the available MBEan names, please take a look into the corresponding documentation. For tomcat, visit the http://localhost:8080/jolokia page and the Jolokia documentation.

* link only available in Enterprise Documentation