Germain can monitor any Java application. The main features of the Germain Java Application monitoring are:
CPU and memory usage
HTTP requests (inbound and outbound)
JMS messages (inbound and outbound)
Calls to any Class Method (custom list at application startup)
Sampler to collect CPU profiling information
JMX access for inspecting agent statistics or configuration remotely (optional)
JRE 8 (Java version 1.8)
There are three steps to installation:
Placing the two agent JAR files in a location accessible to all applications that will be monitored.
Creating a configuration file for each of the applications being monitored.
Starting those applications with an additional
-javaagentargument to the JVM.
Files provided by germain
The agent.properties file is a generic template that can be copied and filled in for each application. Suggestion: name each copy
agent-[APPLICATION_NAME].properties so they can all reside in the same folder. See the section on configuration for the meaning of each property.
Any scripts used to start the existing Java applications need to be modified to pass an additional
-javaagent argument to the JVM.
IBM JVM only JVM Argument:
If you are using the IBM JVM you will need to add the following to any scripts used to start the existing Java applications to include the
Each property described below is necessary to include as a line in a properties file if the desired setting is different than the default value. A minimal properties file includes the
agent.url of the APM server, and
*.enabled=true for the desired features. Logging functionality is there to assist advanced debugging and is not necessary to configure under normal circumstances.
Note: The agent properties file uses the Properties File Format, and as such, backslash (
\) is an escape character, and lines starting with a pound sign (
#) or exclamation mark (
!) are ignored and can be used to comment out the line.
agent.application = My application's name agent.numThreads = 2 agent.runtimeJar = C:\\germain\\agent\\apm-agent-runtime.jar agent.url = http://localhost:8080/ingestion/agent
The name of the application being monitored.
The auto-detected name of the application.
Number of threads used by the germain agent.
Path to apm-agent-runtime.jar.
The same path as the apm-agent.jar appended with /apm-agent-runtime.jar
The URL of the APM server.
agent.feature.servlet.enabled = true agent.feature.outboundHttp.enabled = true agent.feature.jdbc.enabled = true agent.feature.jms.enabled = true agent.feature.processMetrics.enabled = true agent.feature.processMetrics.interval = 60 agent.feature.cpuProfiling.enabled = true agent.feature.method.enabled = true agent.feature.method.0.path = com.packagename.ClassName.methodName agent.feature.method.0.type = eventName0 agent.feature.method.1.path = com.packagename.ClassName.methodName agent.feature.method.1.type = eventName1
HTTP Servlet monitoring
Outbound HTTP request monitoring
JDBC SQL database monitoring
Java process metrics
Time between each sample (seconds)
Sampler duration (seconds)
Custom method monitoring
The fully qualified method name of the first method to be monitored.
A keyword to label this kind of event. Required for each corresponding path.
The fully qualified method name of a second method to be monitored.
A keyword to label this kind of event. Does not necessarily have to be distinct from other type values if it captures the same kind of event.
Any number of methods can be monitored as long as they are numbered sequentially starting with 0.
agent.log.type = FILE agent.log.level = DEBUG agent.log.name = agent agent.log.path = C:\\germain\\logs
NULL, FILE, CONSOLE
ERROR, WARN, INFO, DEBUG, TRACE, NONE
The prefix for log file names.
Directory path for file logger.
agent.packages.skiplist = java,javax,sun,com.germainsoftware.agent,com.mysql,com.zaxxer.hikari,oracle,org.apache,org.glassfish,org.springframework agent.packages.blacklist = com.germainsoftware.agent
Comma-delimited list of Class packages that should be ignored when the agent is determining the application-level caller.
Comma-delimited list of Class packages whose Classes should never generate data as application-level callers.
agent.queue.maxSize = 10000 agent.queue.batchSize = 500 agent.queue.threads = 2
The number of data points that will be held before dropping data from the APM Datamart queue.
The number of data points to send per batch.
Threads used for submitting batches.
Inspecting the agent via JMX
The Germain Java agent registers multiple MBeans via JMX to expose additional statistics at run-time. Any JMX client, such as VisualVM with the MBeans plugin, can be used to connect to the Java process and browse the exported objects.
Caveats of CPU sampling
The agent runs inside the JVM; that means that program errors can affect the monitored application - this is true for any profiler
The agent runs inside the JVM, thus it is subject to Java timer accuracy and garbage collection
The agent cannot distinguish between overloaded methods because they are stored ambiguously in the stack trace.
The agent only counts threads which are in RUNNABLE state
Time spent in filtered methods will be attributed to the last unfiltered caller method