Deploy Monitoring & Automation for Java with GermainUX

Deploy Monitoring & Automation for Java

GermainUX provides deep monitoring, analytics, and automation for Java applications through the GermainUX Java Agent / Code Profiler and GermainUX Engine.

The Java Agent attaches to the JVM at startup using the standard Java Instrumentation API. No application code changes are required.

πŸ“‹ Prerequisites

Requirement

Details

GermainUX

Running and reachable from the monitored environment

JRE

17 for the current Agent; 8 or 11 for the legacy Agent

Supported environments

Apache Tomcat, IBM WebSphere, JBoss/WildFly, standalone Java, and other JVM-based applications

Network

The monitored environment must be able to communicate with GermainUX


πŸ“¦ 1. Deploy the GermainUX Java Agent

Obtain the Java Agent files from GermainUX:

File

Purpose

apm-agent.jar

Java Agent loaded by the JVM

apm-agent-runtime.jar

Runtime classes used by the Agent

agent.properties

Agent configuration template

germain.java.security

Security policy required for IBM JVM only

Place the files in a dedicated directory, for example:

/opt/germainux/agent/
β”œβ”€β”€ apm-agent.jar
β”œβ”€β”€ apm-agent-runtime.jar
β”œβ”€β”€ agent-myapp.properties
└── germain.java.security

Use absolute paths and ensure that the JVM process has read access to the files.

The Agent automatically locates apm-agent-runtime.jar when it is stored in the same directory as apm-agent.jar.


βš™οΈ 2. Create the Application Configuration

Copy agent.properties and create an application-specific configuration file:

agent-[APPLICATION_NAME].properties

For example:

agent-myapp.properties

At minimum, configure the GermainUX server:

agent.url=http://your-germainux-server:8080

The application name can also be explicitly defined:

agent.application=myapp

Setting an application name is recommended when multiple Java applications are monitored on the same host.

Additional monitoring capabilities, exclusions, sampling, privacy controls, and other options can be configured as described in Configure Monitoring & Automation for Java.


πŸš€ 3. Attach the Agent to the JVM

Add the -javaagent argument to the Java application's JVM startup configuration:

-javaagent:/opt/germainux/agent/apm-agent.jar=/opt/germainux/agent/agent-myapp.properties

JDK 17+

When outbound HTTP monitoring is enabled on JDK 17 or later, also add:

--add-exports java.base/sun.net.www.protocol.http=ALL-UNNAMED

IBM JVM

IBM JVM requires the GermainUX security configuration:

-Djava.security.properties=/opt/germainux/agent/germain.java.security

JMX should also be disabled in the Agent configuration:

agent.jmx.enabled=false


πŸ—οΈ 4. Configure the Application Server

Apache Tomcat

Add the Agent to $CATALINA_HOME/bin/setenv.sh on Linux/macOS:

CATALINA_OPTS="$CATALINA_OPTS -javaagent:/opt/germainux/agent/apm-agent.jar=/opt/germainux/agent/agent-myapp.properties"
CATALINA_OPTS="$CATALINA_OPTS --add-exports java.base/sun.net.www.protocol.http=ALL-UNNAMED"

On Windows:

set CATALINA_OPTS=%CATALINA_OPTS% -javaagent:C:\germainux\agent\apm-agent.jar=C:\germainux\agent\agent-myapp.properties
set CATALINA_OPTS=%CATALINA_OPTS% --add-exports java.base/sun.net.www.protocol.http=ALL-UNNAMED

IBM WebSphere

In the WebSphere Admin Console, navigate to:

Servers β†’ Application Servers β†’ [Server] β†’ Java and Process Management β†’ Process Definition β†’ Java Virtual Machine

Add the following to Generic JVM Arguments:

-javaagent:/opt/germainux/agent/apm-agent.jar=/opt/germainux/agent/agent-myapp.properties
-Djava.security.properties=/opt/germainux/agent/germain.java.security

Save the configuration and restart the application server.

JBoss / WildFly

Edit:

$JBOSS_HOME/bin/standalone.conf

and add:

JAVA_OPTS="$JAVA_OPTS -javaagent:/opt/germainux/agent/apm-agent.jar=/opt/germainux/agent/agent-myapp.properties"
JAVA_OPTS="$JAVA_OPTS --add-exports java.base/sun.net.www.protocol.http=ALL-UNNAMED"

Standalone Java

Add the Agent directly to the Java startup command:

java \
  -javaagent:/opt/germainux/agent/apm-agent.jar=/opt/germainux/agent/agent-myapp.properties \
  --add-exports java.base/sun.net.www.protocol.http=ALL-UNNAMED \
  -jar myapp.jar


πŸ–₯️ 5. Monitor Multiple Java Applications

Multiple applications on the same host can share the Agent JARs while using separate configuration files:

/opt/germainux/agent/
β”œβ”€β”€ apm-agent.jar
β”œβ”€β”€ apm-agent-runtime.jar
β”œβ”€β”€ agent-app1.properties
└── agent-app2.properties

Each configuration should have a unique application name:

agent.application=app1

Each JVM then references its corresponding configuration file.


πŸš€ 6. Deploy a GermainUX Engine

The GermainUX Engine complements the Java Agent by providing monitoring and automation capabilities that run independently from the monitored JVM.

Depending on the use case, the Engine can be used for:

  • JVM and application health monitoring

  • Scheduled monitoring

  • Anomaly and SLA detection

  • Alerts and notifications

  • Script and program execution

  • Incident or ticket creation

  • Automated operational workflows

  • Remediation actions

Deploy or select an Engine with network access to the monitored Java environment and the GermainUX platform.

The Agent and Engine can be used independently or together depending on the required monitoring depth and automation use case.


πŸ” 7. Select the Initial Monitoring Scope

The Java Agent supports monitoring of:

  • JVM and process metrics

  • Inbound and outbound HTTP transactions

  • JDBC / SQL

  • JMS

  • Thread pools

  • Connection pools

  • Elasticsearch

  • CPU profiling

  • Custom Java classes, methods, and packages

Most standard application-monitoring capabilities are enabled by default. More detailed monitoring, such as Elasticsearch or custom method instrumentation, can be enabled when required.

For production deployments, start with the monitoring required for the application's critical transactions and progressively expand the scope.

See Configure Monitoring & Automation for Java for detailed configuration.


πŸ” 8. Review Data Privacy

Before enabling monitoring in production, review what application data may be collected.

Pay particular attention to:

  • SQL statements

  • HTTP session identifiers

  • JMS message bodies

  • Method arguments

  • Method return values

  • Application-specific sensitive data

GermainUX monitoring can be configured to exclude, mask, or avoid collecting sensitive information.


βœ… 9. Verify the Deployment

Temporarily enable Agent file logging:

agent.log.type=FILE
agent.log.level=INFO
agent.log.path=/opt/germainux/agent/logs/

Restart the application and verify that:

  • The Agent starts successfully

  • The expected monitoring features are initialized

  • The correct configuration file is loaded

  • The Agent registers with GermainUX

  • Java telemetry is received by GermainUX

If the Agent cannot temporarily reach GermainUX, the connection error is logged without preventing the Java application from starting.

Agent activity can also be inspected through JMX using VisualVM or JConsole:

com.germainsoftware.agent:type=Statistics

Once validated, review monitoring overhead and progressively enable additional monitoring, analytics, alerts, and automation as required.

ℹ️ Get Help

The Germain Team can help you set this up. Contact GermainUX Support.

 

Component: Agent, Engine

Feature Availability: 2022.1 or later